Delete suppressed components in iLogic

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
         Call DeleteSuppressedComponent(occ.SubOccurrences)
     End If
End Sub

 If you have any enquiries, please send us a message:

Request More Information

Inventor 2015 Service Pack 2
Vault override user check out / Undo any user chec...

Related Posts

By accepting you will be accessing a service provided by a third-party external to

Autodesk reseller uk logo2
qms microsoft logo