set reference files in micro station drawing

Hi All,

 We need set reference files and get reference files in a microstation drawing, through our custom code. Please guide me or if possible please provide sample code.

Thanks

Parents Reply
  • Hi Jon,

    Thanks for the article. We have a java based application but as JMDL is obsolete, so we need to do something on .NET and C#. This thing I need to explore which language JNI supports. But Thanks for VBA guide.

    One more thing, I am able to create macro using VBA in Microstation as well as in Excel which provide reference file details. And in case of excel macro I am able to run it via vbs script file.

    I don't know whether withing macro in excel is right way or can you  tell me how  we can run microstation macro through vbs.

    Because I am thinking that I will call macro, and it will write all reference file details in local system file, which we can read later on.

    Thanks & Regards

Children
  • VBA and COM

    Both MicroStation and Excel provide VBA. As you will discover, VBA is similar whichever application provides it. Apart from application-specific classes, one implementation of VBA is like another.

    VBA supports COM. You can reference another application from VBA. This works with MicroStation and Excel (and other Microsoft Office products, for that matter).

    1. Open the VBA Interactive Development Environment (IDE)
    2. Use menu Tools|References to pop the COM References dialog
      • If you are using Excel VBA, browse through the list to find the Bentley MicroStationDGN.Application
      • If you are using MicroStation VBA, browse through the list to find the Microsoft Excel.Application

    You can now uses classes from the other application in your VBA code.

    Here's an example of VBA code to enumerate references.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Hi Jon,

    Thanks for the example. I am able to get references from Java class.

    I am using java com bridge, and from that com bridge,I am able to get and set reference from java.

    Thanks for your help.

    Thanks Regards

    Amit Agarwal