- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is this iLogic rule a 'local' rule, or an external rule? If it is a local rule, is it saved in the target part file, or in the assembly file? If it is a local rule and saved in the part file, you can set "oDoc = ThisDoc.Document" to ensure it is always referring to that specific part file. If it is local and saved in the assembly, avoid using "ThisDoc", and stick with what you've got, but I would at least include a DocumentType check at the beginning of the rule, and if it's not a Part document, use a MsgBox() or MessageBox.Show() to inform yourself (user) about it, then either "Exit Sub" or "Return".
If it is an external rule, I would also likely stick with your current reference, but also include the document type check at the beginning. You might even try the ThisApplication.ActiveEditObject route, even though that seems less likely.
Also, just inside your loop of the SelectSet, you might want to check what Type of object it is before attempting to use it.
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS)
.
If you have time, please... Vote For My IDEAS
or you can Explore My CONTRIBUTIONS
Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield
(Not an Autodesk Employee)