The general architecture and main components used by a MicroStation based application that consumes an i-model and outputs the information to a 3rd-party respository/format is depicted in the diagram below.
Using the SDK, the MicroStation App would perform the following tasks:
-
Open the i-model.
-
If the current Session is not viewing the i-model to process then use the mdlSystem_newDesignFile function or the SessionMgr to open the i-model.
-
Process the Active Model. To get the active model, use the SessionManager and call GetActiveModel.
-
Use the GetDgnCache from which it will iterate across the graphical elements in the cache.
-
Read the graphics from the i-model.
-
Using an iterator, each element will provide the DGN graphic for each element in model.
-
Using the ElementGraphicsProcessor class invoke the Process method.
-
The process method will require an ElmHandle and a reference to a sub class of the IElementGraphicsProcessor class.
-
Read the business data from the i-model.
-
To read the business data, the MicroStation App needs to use the XmlInstance API.
-
For each element processed, a call to XmlInstanceAPI.ReadInstances returns a list of the attribute data as an XML fragment.
-
Attribute data is formatted as an XMLFragment that needs to be processed using the appropriate XML API.
-
Reads the provenance information from the i-model.
-
Create a reference to the ProvenanceManager using the static method provided in the class.
-
Extract the needed provenance information either as an XML fragment or a list of specific data sources.
-
Writes the information to the 3rd-party repository/file using the method most appropriate for the performing the task (e.g., 3rd party API, etc.).
The libraries required for this use case are:
-
Bentley.XmlInstanceNative.lib
-
Bentley.IModelConnection.lib
-
Bentley.ProvenanceNative.lib
-
Bentley.Publish.lib