Modifying Design link URLs in Connect Edition using C# or VBA

I have a requirement from a customer to write a (once only throw-a-way) tool to run through a number of DGN files and update the base address in all of the link URLs. The links are a mixture of Engineering links (older V8i generated ones) and design links (newer connect edition generated ones). They are in the process of moving the linked file to a new SharePoint site (on-prem to O365)

Modifying V8i Engineering links look to be straight forward using VBA as they are implemented using TAGS. However the Connect Edition design links are a different story as it looks like they are stored using XAttributes from what I can tell.

I am seeking some advice and possibly sample code that I can adapt/include in a .NET (C#) command line program/tool to handle the newer form of links.

Parents
  • Hi,

    as it looks like they are stored using XAttributes from what I can te

    Yes and no ;-)

    My assumption is that Design Links are stored as EC data attached to the elements. And EC data (and EC classes) are stored internally as XAttributes.

    I am seeking some advice and possibly sample code that I can adapt/include in a .NET (C#) command

    I am not aware of such example or code snippet, but to learn more how to work with EC data is recommended (it seems to be common required knowledge for CE development anyway ;-). Different aspects how to get schemas and data related to a specific element have been discusses many times already.

    With regards,

      Jan

  • Thanks Jan

    I have done some work with the earlier V8i iterations of the EC Framework implementation in the past. Looks like I will need to make the case to my boss to reinstate or BDN subscription so I can get access to the latest SDK documentation and samples.

  • Hi,

    I have done some work with the earlier V8i iterations of the EC Framework implementation in the past.

    In MicroStation CONNECT Edition, EC Framework plays much bigger role than in V8i, so it's good to have such experience, but it's important to increase it and adapt it to CE condtions.

    • EC API is more rich and exists both in native (C++) and managed (NET) APIs.
    • New features like ItemTypes are implemented as EC data (ItemTypes are represented by ad hoc internally created EC schema).
    • Nearly everyhing (not sure whether it's 100%) in DGN file (including control elements, discussed DesignLinks, relationships) can be accessed using EC API, regardless these features are stored as EC data or not.
    • EC schemas describing MicroStation elements (and more) are available in Schemas folder in MicroStation and can be used for learning ;-)
    Looks like I will need to make the case to my boss to reinstate or BDN subscription so I can get access to the latest SDK documentation and samples.

    In fact you do not SDK to access NET API, because all assemblies are delivered with MicroStation. But without documentation and examples, it would be seriously hard to understand and use API and write own code.

    My assumption is that Design Links are stored as EC data attached to the elements.

    I did some more research and testing and this my original assumption is not correct, so there is new my summary:

    • There is no "DesignLinks API" available and DesignLinks data are accessible through EC API, it has not changed.
    • But DesignLinks are stored (or are visible using API at least ;-) as independend data and "linked" to an element using defined relationship.
    • In EC approach, it means the relation is ElementAnnotationLinksRelationship class(defined in DgnContentRelationshipSchema), DesignLink definition is Leaf class defined BentleyDesignLinksPresentation schema, where every DesignLink type is represented by own inherited EC class (e.g. discussed URL link is represented by URLLinkProperties class where Address and DisplayName properties are used).

    In this discussion you can see in this discussion how data connected with an element throug defined relationship can be accessed (tags in this case). There are also some blogs about using EC data, not bad summary is e.g. EC CRUD Operations, which is an extraction from an example delivered with MicroStation SDK.

    Another good tool helping "EC world" learning is "ecx items dump": The created XML represents a transformation of active DGN file to "EC language", so it often provides usefull details how DGN data structures are internally interpreted as EC data.

    With regards,

      Jan

    Answer Verified By: davhum75 

Reply
  • Hi,

    I have done some work with the earlier V8i iterations of the EC Framework implementation in the past.

    In MicroStation CONNECT Edition, EC Framework plays much bigger role than in V8i, so it's good to have such experience, but it's important to increase it and adapt it to CE condtions.

    • EC API is more rich and exists both in native (C++) and managed (NET) APIs.
    • New features like ItemTypes are implemented as EC data (ItemTypes are represented by ad hoc internally created EC schema).
    • Nearly everyhing (not sure whether it's 100%) in DGN file (including control elements, discussed DesignLinks, relationships) can be accessed using EC API, regardless these features are stored as EC data or not.
    • EC schemas describing MicroStation elements (and more) are available in Schemas folder in MicroStation and can be used for learning ;-)
    Looks like I will need to make the case to my boss to reinstate or BDN subscription so I can get access to the latest SDK documentation and samples.

    In fact you do not SDK to access NET API, because all assemblies are delivered with MicroStation. But without documentation and examples, it would be seriously hard to understand and use API and write own code.

    My assumption is that Design Links are stored as EC data attached to the elements.

    I did some more research and testing and this my original assumption is not correct, so there is new my summary:

    • There is no "DesignLinks API" available and DesignLinks data are accessible through EC API, it has not changed.
    • But DesignLinks are stored (or are visible using API at least ;-) as independend data and "linked" to an element using defined relationship.
    • In EC approach, it means the relation is ElementAnnotationLinksRelationship class(defined in DgnContentRelationshipSchema), DesignLink definition is Leaf class defined BentleyDesignLinksPresentation schema, where every DesignLink type is represented by own inherited EC class (e.g. discussed URL link is represented by URLLinkProperties class where Address and DisplayName properties are used).

    In this discussion you can see in this discussion how data connected with an element throug defined relationship can be accessed (tags in this case). There are also some blogs about using EC data, not bad summary is e.g. EC CRUD Operations, which is an extraction from an example delivered with MicroStation SDK.

    Another good tool helping "EC world" learning is "ecx items dump": The created XML represents a transformation of active DGN file to "EC language", so it often provides usefull details how DGN data structures are internally interpreted as EC data.

    With regards,

      Jan

    Answer Verified By: davhum75 

Children
No Data