Hi everyone,
I saw a few posts that explained how to export the models in a dgn file to seperate DWG files
https://communities.bentley.com/products/microstation/f/microstation-forum/171130/export-file-with-multiple-models-as-seperate-files/492329
, however I was wondering whether it's possible to save a dgn file with multiple models to seperate dgn files instead.
Joy van Vliet said:I was wondering whether it's possible to save a dgn file with multiple models to seperate dgn files
Season's Greetings! Try the macro described here. Unzip it and move ModelExporter.mvba to your workspace macros folder...
ModelExporter.mvba
You are the test pilot!
Regards, Jon Summers LA Solutions
Answer Verified By: Joy van Vliet
Hi Jon,
I've not tested your macro but I did read the description of what it does. Initially, I also considered this approach however a problem I thought I would have with it is, when you have a DGN file where the only model should be a model that is not the 'defaultmodelreference' of the source DGN, you cannot delete the 'defaultmodelreference' to leave only the desired model.
My approach instead would be to reference each model from the source DGN file in into the 'defaultmodelreference' of each new DGN (created using Scripting Runtime copying from MS_DESIGNMODELSEED), scan & copy all non-graphical elements, and then detach the reference.
I've found that we can now change the "Default" model in the model dialog and then delete the "old" default model. If we can now also do that via vba then perhaps swap the default model to that we want to keep.
Regards,
Mark
OpenRoads Designer 2022 R3 (10.12) | Microstation 2023.1 | ProjectWise CE 3.4
Side question how did you get a compress process using OpenDesignFileForProgram?
I assume that must be a new Connect feature (which I’m naturally not aware of). It sounds like a positive change as the feature of a default model is something which I’ve never found to be of any benefit, more so completely pointless and a hindrance on occasion.
hi Jon Summers , sorry for the late reply,I tried your mvba and it worked like a gem! The only issue I face, just like Mark Shammon mentioned is the file is still as the original file.is there a way to include some vba code in the mvba tool that does achieve that?