I need to evaluate the global origin within files for a particular project and verify if he Global Origin is offset from the design plane/cube. Rather than gong into each file and using the keyin GO=$ to check each file and multiple models within each file, I would like to use a vba project to open the files, obtain the Global Origin and then report that value to a text file.
What is the best way to go about creating that vba? I would run this vba using the batch process.
TIA,
Mike
Hi Mike,
as usually, please follow the best practices and specify used product and version.
mwlong said:What is the best way to go about creating that vba?
Create a new macro n VBA project manager, set it to be loaded automatically and in Batch Process, call it.
mwlong said:I would like to use a vba project to open the files
It is in conflict with idea to use Batch Process: Design files can be opened by VBA macro or by Batch Process, but not both, because it would lead to not working chaos. I recommend to use Batch Process to process DGN files and individual models, because to open files from macro in the right way can be tricky.
mwlong said:and then report that value to a text file.
GlobalOrigin is a property of all ModelReference objects (including ActiveModelReference), so it's simple to open text file, write the values to the file and close it.
You can even use the property directly from key-in:
macro vba execute MessageCenter.StatusMessage = "GO=" & CStr(ActiveModelReference.GlobalOrigin.X) & ", " & CStr(ActiveModelReference.GlobalOrigin.Y) & ", " & CStr(ActiveModelReference.GlobalOrigin.Z)
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said:please follow the best practices and specify used product and version.
Sorry about that. Not sure why my versions are not listed in my post as they usually are. Version is Microstation CONNECT U17 (10.17.00.209)
Jan Šlegr said:It is in conflict with idea to use Batch Process:
Yes, I meant to say process the dgn files with Batch Process
Thanks for the suggestions
Microstation CONNECT - 10.17.2.61
ORD - 2021 R1 10.10.1.3
ORD 2022 R1.1 - 10.11.3.2
ORD 2022 R3 - 10.12.2.4
Microstation v8i SS 10 - 08.11.09.919
Power InRoads v8i - 08.11.09.615
ProjectWise - 10.0.3.453