How do I export my business data to i-model

I am about to write some VBA code to put some extra data (business data) on MicroStation elements.

If I want to read these, with element information, when the .dgn file is exported to an i-model, how do I write the data. Which type of element data should I use.

There are several methods, Linkage, Tags, text node etc.

Any good advise?

  • Hi Finn,

    ok, a few thoughts and recommendations:

    I recommend to move your question to MicroStation Programming forum, because it's about programming. You should be able to do it yourself, check what is in "More" menu under your post.

    Read MicroStation Porgramming forum best practices and provide necessary information, especially MicroStation version you use.It's possible to change Subject using More > Edit.

    You cannot use VBA, MicroStation VBA API does not contain any functions for i-model and business data.

    It's not possible to create i-model by own code (regardless C++, NET or VBA is used), you have to prepare data in required format, so MicroStation will be able to transform it into i-model properly.

    The whole process is quite straightforward: When i-model is published, non-graphic data is stored as EC instances attached to elements. I guess this is the reason why by default EC data only is published, because MicroStation don't convert other custom data like Tags to i-model business data.MicroStation C/C++ API allows to interact on i-model publishing (I guess in V8i (SELECT series 3) and newer at least), but crucial is the conversion of your data into EC data. And it is the complicated part...

    In V8 there is NET API available (some operations can be done as low-level also in C++, but I guess it a way how to make mistakes easily), in CONNECT Edition I suppose similar functionality exists both in C++ and NET API.

    For every "type of data" own EC class has to exist. If your data is "fixed structure", EC schema(s) with EC classes can be created manually using Bentley Class Editor (part of MicroStation SDK installation). If the structure can change (eg. because of different TagSets), EC schemas have to be created on-the-fly using the mentioned API and stored in DGN file before the conversion.

    After EC schema is created and stored in DGN file, original data can be transformed and attached to element(s) as EC data instance(s).

    In summary, what you would like to implement requires knowledge of several different topics and APIs (EC technology, C++ API, NET EC API) and a substantial amount of mandays (writing on my own experience).

    In MicroStation CONNECT Edition the implementation can be simplified a bit, because Item Types (which are represented by specific EC schema) can be used. But still VBA is not a proper tool because of lack of Item Types API and also poor support for linkages.

    With regards,

      Jan

    Answer Verified By: Finn Mejding 

  • I am about to write some VBA code to put some extra data (business data) on MicroStation elements

    In which version (e.g. v10.x.y.z) of MicroStation?

    There are several methods, Linkage, Tags, text node etc

    Also consider ECSchema data, or Item Types in MicroStation CONNECT.

     
    Regards, Jon Summers
    LA Solutions

  • For what it's worth, much of the Item Types functionality in CONNECT Edition (creating/modifying Item Types, attaching Items to elements, etc) can be scripted using keyins. I believe VBA supports invoking keyins?

    Either way. Item Types definitely sounds like the most straightforward solution, assuming Finn is using CONNECT Edition.

  • Jon,

    We're still working in SELECTseries 3, but the solution should not be limited to this. We will go to Connect when all the applications we use are avaiable.

    I will consider every sugestion, as long as the informaqtions will be available in the imodel.

    Finn

    Regards,

     

    Finn Mejding

    CAD Manager

    Railway and Metro

    COWI

  • We're still working in SELECTseries 3

    In that case, Jan's summary should guide you.  With MicroStation V8i, .NET is your best bet; VBA is not an option.  Start by becoming familiar with ECSchemas and the EC Class Editor.

    Item Types definitely sounds like the most straightforward solution, assuming Finn is using CONNECT Edition

    You could consider using MicroStation CONNECT for this purpose.  Create your DGN models in MicroStation V8i, InRail or whatever, and use CONNECT to annotate them with your own Item Types.  MicroStation V8i will still be able to open those DGN files.

    Item Types provide a simpler (C++) API than the ECSchema API in V8, so you'll progress faster.  But still no VBA support, unless key-ins are feasible.

     
    Regards, Jon Summers
    LA Solutions