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

if you run the rule from an assembly then "ThisApplication.ActiveDocument" will return the assembly document. You will need to get the part document object. From the code you gave i cant tell how you want to do that. But if you want to convert all part documents you could try the code below

 

Dim doc As AssemblyDocument = ThisApplication.ActiveDocument
For Each refDoc As Document In doc.AllReferencedDocuments
    If refDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
        ThisApplication.ActiveDocument.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}"
    End If
Next

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com