Can't access Part Document from Assembly if Part is not previously set to Master Model State
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an iLogic rule that will place multiple model states of a part file into an assembly, and everything works perfectly as long as the part document has the master model state active, but if any other model state is active, the rule throws an error.
To see majority of the code I am using, see the solution for this forum: https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/find-names-of-all-model-states-in-co...
In particular, the line of code that throws the error is:
Dim oPDoc As PartDocument = ThisApplication.Documents.ItemByName(filepath)
' filepath is a string with the filepath to the part document on my computer set earlier in the code
The error I get is:
Due to the error occurring at this point in the rule, I am unable to activate the master model state in the part document via the rule to circumvent this error.
Is anyone else having a similar issue? (I'm trying to figure out if this is a bug in Inventor's programming that can get fixed in an update down the road.)