Microstation Basic Macro

I created a Microstation Basic Macro to attach a reference file (e.g. border sheet) to multiple files in a folder. The macro runs perfect except that the Reference Attachment Settings dialog pops up and I have to click the "OK" tab for every file on the list. Is there a way to automate this or add line into the Macro so I don't have to hit the 'OK' tab? If there is, what should be the Microstation basic command I should add into the macro.?

 macro?

Parents
  • Hi ,

    As Jon recommends, MicroStation VBA macros would be a better way to future proof this and future customizations you may need to create.

    Since you are asking to automatically close the dialog while attaching a reference, from one perspective this may imply that you do not need the file selection dialog box at all - if you know the exact full path and file name you wish to attach.  If this is the case, consider simply sending an appropriate key-in to attach a reference file or raster image; shown (and compatible) with ProjectWise managed locations; simply replace with your own local full paths and file names needed if you wish to test or use this approach.

    Here are two samples keyins to attach a MicroStation design file and a raster reference to the active model:

     MicroStation Key-in to Attach a ProjectWise managed Design File as a MicroStation Reference
     rf=pw:\\mypwsrv.mycompany.com:mydatasource\Documents\RHook\LotsOfLevelsTest.dgn,Default,MyLogicalName,MyDescription,Top;SELV ALL

     MicroStation Key-in to Attach a ProjectWise managed Raster File as a MicroStation Raster Reference
     RASTER ATTACH [fixed|interactive] pw:\\mypwsrv.mycompany.com:mydatasource\Documents\images\test.tif

    HTH,
    Bob

    Reference: Attach a reference file programmetrickly (pardon my language :-)) using Object GUID or similar



  • I totally agree with all the aboves. Using key-in command is most easy way. MVBA is much better than MicroStation Basic.

    I have a new suggestion, considering you are working in PW, there might be some codes running in PW, such as titleblock mapping. Such codes will run automatically open a new drawing in PW and it takes time. I might consider to export all the files to local, add references locally, import files into PW, scan references. It might save some time.

  • Hi ,

    Just to clarify, the Original Poster (OP) did not mention using ProjectWise.  I simply re-used an existing suggestion in a (proven) form that shows ProjectWise compatible key-ins and stated to replace with (Local) Full Path and File Names (filespec) and everything should work equally as well.  Sorry if that may not have been clear when reading my post.

    Thank you for your additional ProjectWise considerations added.

    Bob



  • you may find it easier if you attaching the same ref file to just use the batch processor with the ref attach keyin instead

    the following keyins work without having to accept and will work in your batch processor

    (world coincedent )
    RF=filenameofRef,,,,#

    (coincedent)
    RF=filenameofRef,,,,*

      (but goof practice would be to add the fit view  extended and file design commands )

    FYI

    (top)
    RF=filenameofRef,,,,top
    but top requires a data point

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

    Answer Verified By: Cezar Pangilinan 

Reply
  • you may find it easier if you attaching the same ref file to just use the batch processor with the ref attach keyin instead

    the following keyins work without having to accept and will work in your batch processor

    (world coincedent )
    RF=filenameofRef,,,,#

    (coincedent)
    RF=filenameofRef,,,,*

      (but goof practice would be to add the fit view  extended and file design commands )

    FYI

    (top)
    RF=filenameofRef,,,,top
    but top requires a data point

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

    Answer Verified By: Cezar Pangilinan 

Children
No Data