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.
Hi,
davhum75 said: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.
davhum75 said: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
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
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.
davhum75 said: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.
davhum75 said: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.
Jan Šlegr said: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:
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.
Answer Verified By: davhum75