I am trying to use VBA to rename the Default model within a series of existing dgn files, however I can find no way to isolate it.
The only obvious difference between the Default model and the other models is that the Default model cannot be deleted.
I could find the Default model in a file by deleting each model in turn to see if it throws an error, then undo the deletion if it doesn't.
The one that throws the error is the default, but that's a pretty crude way to do it.
Because the Models Dialog box tool bar grays out the Delete command when the Default model is selected, there is obviously some way to isolate it.
Can someone please advise how to do it cleanly.
Searching MicroStation VBA help file for "default model" phrase leads quickly to Changing an Attachment to Reference the Default Model code snippet example. Based on the code it seems this should work:
Dim defaultModel As ModelReference Set defaultModel = ActiveDesignFile.DefaultModelReference
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point