Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: lhintonC3ZNZ

Hi @lhintonC3ZNZ.  For starters, change this:

Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument

...to this:

Dim oDoc As PartDocument = ThisDoc.Document

I believe what is going on in this situation is the code is targeting the main assembly, because it is the 'active' document in that situation, instead of the part you area creating.  This change will force the code to target the local document (the document that the rule is saved within.).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)