I am trying to use VBA to replace the models in drawing views.
I have gotten this to work using the two published methods, ReplaceViewModel, and ReloadOrReplace however each presents different difficulties in different scenarios.
I would like something that works exactly like this feature in the open... dialog box:
However none of these published methods work like this.
In the case of ReloadOrReplace, all documents are required to be closed to do the swapping. This doesn't work nicely in the cases I'm using because I'm doing this from within an assembly that I want stay open. If I close all documents prior to doing the open and replace, this method seems to work alright. I could make a hack where I close all documents, do the replace, and open the documents again, but that would be clunky.
Using ReplaceViewModel works better in theory since I'm working from an open assembly, and so the model reference can stay open when I replace the views. But when I use this method, almost all the dimensions in the drawing view become dangling. This doesn't happen when I use open from references or ReloadOrReplace.
So is there any way to do this, either using ReplaceViewModel while maintaining dimension and annotation references, or possibly using a method to "Open With References" like I can do interactively in the dialog?