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

Is it currently possible to add a sub-assembly into an assembly and then from that top-level assembly run a rule that could use the Components.Add to the sub-assembly?

 

Something similar to this maybe?

 

SyntaxEditor Code Snippet

If openDoc.DocumentType = kAssemblyDocumentObject Then  
    For Each docFile In openDoc.AllReferencedDocuments      
        FNamePos = InStrRev(docFile.FullFileName, "\", -1)        
        docFName = Mid(docFile.FullFileName, FNamePos + 1, Len(docFile.FullFileName) - FNamePos)

        If docFile.IsModifiable = True Then          
			assemblyDoc = openDoc  
			assemblyDef = assemblyDoc.ComponentDefinition
			Dim componentA = docFile.Components.Add("nozzle 1", "C:\Users\Public\2019\PIPES\PIPEC2-40-8.ipt",
position := Nothing, grounded := True, visible := True,
appearance := Nothing) End If Next End If