08-31-2021
03:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-31-2021
03:32 AM
you can try this one for Material,
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAsmCompDef.Occurrences If iProperties.MaterialOfComponent(oOccurrence.Name) = "Steel" oOccurrence.Visible = False Else End If Next
To looping thru all occurance, it's bit gerneric but you can modify it for your need,
Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument Dim oAsmDef As AssemblyComponentDefinition oAsmDef = oAsmDoc.ComponentDefinition Dim oLeafOccs As ComponentOccurrencesEnumerator oLeafOccs = oAsmDef.Occurrences.AllLeafOccurrences Dim oOcc As ComponentOccurrence For Each oOcc In oLeafOccs 'add previous rules Next
Bhavik Suthar