If you would like to use iLogic to delete all suppressed components in an assembly you can use the code below. An example for using this would be if you are trying to export the BOM directly from the assembly environment, suppressed parts are included on export and there is no option to exclude, deleting the suppressed parts would give you the correct BOM for export.
The code below could also be adapted to delete specific components from an assembly. A special thanks to Adam Nagy from the manufacturing dev blog who originally posted this code.
Sub Main()
Dim doc As AssemblyDocument
doc = ThisApplication.ActiveDocument
Dim acd As AssemblyComponentDefinition
acd = doc.ComponentDefinition
Call DeleteSuppressedComponent(acd.Occurrences)
End Sub
Sub DeleteSuppressedComponent(occs As ComponentOccurrences)
Dim occ As ComponentOccurrence
For Each occ In occs
If occ.Suppressed Then
occ.Delete
Else
Call DeleteSuppressedComponent(occ.SubOccurrences)
End If
Next
End Sub
http://adndevblog.typepad.com/manufacturing/2015/02/delete-suppressed-components-in-ilogic.html
If you have any enquiries, please send us a message:
By accepting you will be accessing a service provided by a third-party external to https://www.graitec.co.uk/