Export All the CoOrdinates

Hai,

I want to export the CoOrdinates of all elements in a dgn. How to perform this by using vba? [Microstation version 0.8.05.01.25 Windows x86]

Parents
  • Hi Dharmarajan,

    your question is pretty general (what means "all elements", what output format is required and other details are missing), so only general answer can be provided.

    At first you should evaluate if VBA is really required and if XYZ Tool export functionality, which is available in MicroStation by default, isn't enough for your purposes.

    If VBA is the way from any reason, the code will be probably more "extensive/long" than "complex":

    • Enumerate through all graphic elements in a model. This is a standard piece of the code, described many times both in BE Communities and in Learning MicroStation VBA book (which is a great source of code examples).
    • Every element type has to be processed individually, which leads to a huge select/case construction.
    • Complex elements should be processed recursively.
    • You have to define what coordinates are imporant for you. It's easy in the case of line / line string, but what about e.g. circle or curves?
    • You also have to define what is required output format (e.g. txt, how formatted etc.), but it's general VBA question not specific to MicroStation.

    You should be aware it's not possible to process all elements in the file using MicroStation VBA, because VBA API doesn't provide access to all element types (e.g. to 3D solids).

    With regards,

      Jan

  • Hai Jan,

    I have to just export the CoOrdinates for a collection of dgn files. As you mentioned, the functionality which is available in Microstation by default, is well enough for my purpose. But in case of many dgn files, it would be a time consuming process, if it is done manually.

    I tried recording a macro(for inbuilt export Coordinates functionality) - Refer attachment. But unable to manipulate the click event of buttons(Single/Fence/All) which is available in that (Export Coordinates)dialog box. Is there anyother way/option to execute this inbuilt functionality for the collection of dgn files(like Batch mode)?

    TestExport.mvba

  • Unknown said:
    Is there anyother way/option to execute this inbuilt functionality for the collection of dgn files(like Batch mode)?

    Have you checked available key-ins? There is a full suite of key-ins like export file, export prefix etc. that seem to be suitable to set all export parameters. And if the parameters can be set using key-ins, they can be used in the batch process.

    It's a shame you use so old MicroStation version, because it's much easier to set active tool parameters in the current V8i.

    Regards,

      Jan

Reply Children
No Data