
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am in a drawing file.
I would like to reach for the Model Document of this drawing file, but in a specific way.
I need to do it not directly, but in an opened View (and by View I mean window), that's what makes things more complex.
I tried 2 solutions:
oView = ThisApplication.ActiveView model = oView.Document.File.ReferencedFiles.Item(1).AvailableDocuments.Item(1)
and:
oView = ThisApplication.ActiveView model = oView.Document.AllReferencedDocuments.Item(1)
When a drawing has only one reference - it works ok in both solutions.
When a drawing has many references (for example I have reference of an assembly and of a part of this assembly), it may happen, that I reach for wrong model document.
In attachment you'll find an example, where drawing has 2 references: Support (assembly) and Flat profile (part of this assembly).
My solution reaches Flat Profile instead of Support (that is because in this case Support is Item(2) - I don't know why not Item(1))
The drawing itself can recognize the main reference I need - the title block has correct values.
Maybe You have some idea how to solve it?
Solved! Go to Solution.