Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, i want a way to change every appearance of a occurence that is in kReferenceBOMStructure, and disable the appearance substitution when its on kNormalBOMStructure.
Here is a code that I made to loop through all document occurences and test his BOMStructure type.
Sub Change_Reference_Color Dim Assembly_Doc As AssemblyDocument = ThisApplication.ActiveDocument Dim oAsmCompDef As AssemblyComponentDefinition = Assembly_Doc.ComponentDefinition Dim oRefDocs As DocumentsEnumerator = Assembly_Doc.AllReferencedDocuments Dim oRefDoc As Document 'Dim MainAssetDoc As Assets = Assembly_Doc.Assets 'Dim Reference_Asset As Asset = MainAssetDoc.Item("Azul - Tinta de Parede - Com Brilho") Dim oCompOcc As ComponentOccurrence For Each oRefDoc In oRefDocs For Each oCompOcc In oAsmCompDef.Occurrences.AllReferencedOccurrences(oRefDoc) If oCompOcc.BOMStructure = BOMStructureEnum.kReferenceBOMStructure Then MsgBox("reference: " & oCompOcc.Name) Else MsgBox("normal: " & oCompOcc.Name) End If Next oCompOcc Next oRefDoc Assembly_Doc.Update2(True) End Sub
Now I need a way to change this:
Of every part in reference, and
remove every appearance changes to the kNormalBOMStrucure occurences.
Thanks for the attention
Solved! Go to Solution.