@_bmiller_ ,
Reading twice, I'm not so sure about your question. Do we have to copy the iProperties only to sub assemblies, or are parts included ? What is the sub assembly has sub-assemblies ? Do we also consider them ?
If we say yes to all questions, here would be the code :
Dim doc As Inventor.AssemblyDocument = ThisApplication.ActiveDocument
Dim acd As Inventor.AssemblyComponentDefinition = doc.ComponentDefinition
For Each p As Inventor.Property In doc.PropertySets.Item("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
For Each occDoc As Inventor.Document In doc.AllReferencedDocuments
If occDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Continue For
Dim cpset As Inventor.PropertySet = occDoc.PropertySets.Item("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
Dim exist As Boolean = False
For Each op As Inventor.Property In cpset
If op.Name = p.Name Then
exist = True
Exit For
End If
Next
If exist = True Then Continue For
cpset.Add(p.Value, p.Name)
Next
Next
Kind regards,
FINET L.
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"@LinkedIn @JohnCockerill