Good morning,
I am trying to create a Batch Process which will replace one reference in the plan sheets DGNs with another reference.
Is there a command script for that?
Also, can someone please send me a spreadsheet or word document with all the Batch command scripts so I can expand my knowledge in the batch processing.
Thank you so much!
A batch process command file is just a text file with a list of microstation key-ins in it, one per line.
There is no key-in for changing the path of a reference file, you can implement this vba to add the functionality:
https://communities.bentley.com/products/programming/microstation_programming/f/archived-microstation-v8i-vba-forum/73615/refrename-mvba
Put that into a vba, then make sure your MicroStation autoloads the vba via the MS_VBAAUTOLOADPROJECTS variable in your configuration.
The key-in to run a vba, if it's named as in that thread linked above is:
vba run RefReplaceAttachment
add that to a text file then use that text file as your Batch Process command file
theodore95 said:can someone please send me a spreadsheet or word document with all the Batch command scripts so I can expand my knowledge in the batch processing.
This doesn't exist. No example batch process command files ship with MicroStation so every company has their own set.
Nearly all of the command keyins can be found in the Help, often under the command itself.
Keyins can be strung together with the use of semicolons:active angle 0;active scale 1and a command file can have multiple rows of keyin commands.
If you can run your keyin commands through the keyin broswer, you should be able to run them as a command file for a batch process.
As far as "replacing" a reference, there is no simple command to do that. You would have to detach the original reference and attach the new one. You may be able to do that through keyins, but it could get complicated if you have to do any scaling, rotating, moving or clipping. For all of that, you might need to develop a VBA routine, which could be run through a key-in in a command file.
Reference keyins can be found in the Help file under "References, Raster Images and Point Clouds". Expand that topic, and there is a section specifically named "References Keyins"
MaryB
Power GeoPak 08.11.09.918Power InRoads 08.11.09.918OpenRoads Designer 2021 R2
Hi Kevin,
I did create a VBA with the commands in the link you provided and changed the path and files names in the code.
Then I autoload it in MS_VBAAUTOLOADPROJECTS
Then I also created a text file like you said vba run FILENAME and ran a batch process with this text file..
And it did not work. Can you please advise? I think I am missing something. Thank you!
If you detatch and attach new you loose all settings that you may have done (levels off, overrides, etc.) to the first reference. So the rename reference approach here is good to keep the seetings.
For example you get a new revision of a "background" file that you only need to see particular levels of in your context (floorplans, terrain etc,)
I do it manually in the reference dialog > filename and exchange the previous version with the new one. That keeps all the settings intact - like the above tool probably will.
Maybe you also get something out of these threads
Replace Reference File in Multiple Drawings - MicroStation Forum - MicroStation - Bentley Communities
Remapping reference files in a batch process - MicroStation Forum - MicroStation - Bentley Communities