Hello.
Im working on this code to suppress components with BOM structure is set to reference.
It does'nt work.
Need help please.
Thank you.
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition Dim CompOcc As ComponentOccurrence For Each CompOcc In oAsmCompDef.Occurrences If CompOcc.Definition.BOMStructure.kReferenceBOMStructure = True Then CompOcc.IsActive = False End If Next
Solved! Go to Solution.
Solved by marcin_otręba. Go to Solution.
Solved by JelteDeJong. Go to Solution.
try this:
Dim oAsmCompDef As AssemblyComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition For Each CompOcc As ComponentOccurrence In oAsmCompDef.Occurrences ' go to next occurence if its already suppressed If CompOcc.Suppressed = True Then Continue For End If 'suppress when the bom structure is set in the part/assembly If CompOcc.Definition.BOMStructure = BOMStructureEnum.kReferenceBOMStructure Then CompOcc.Suppress() End If 'suppress when the bom structure is set in the assembly occurrence If (CompOcc.BOMStructure = BOMStructureEnum.kReferenceBOMStructure) Then CompOcc.Suppress() 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.
Blog: hjalte.nl - github.com
try:
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition Dim CompOcc As ComponentOccurrence For Each CompOcc In oAsmCompDef.Occurrences If CompOcc.BOMStructure = kReferenceBOMStructure Then CompOcc.Suppress End If Next
Can't find what you're looking for? Ask the community or share your knowledge.