去评论
距米网-精简版

使用iLogic删除已抑制的装配体中的零部件

JUMU
2021/06/17 22:00:44
Here's how to do it, ignoring occurrences in patterns.
  1. Trace.WriteLine("   Starting....")

  2. Dim oComp As ComponentOccurrence
  3. Dim oComps As ComponentOccurrences

  4. oComps = ThisDoc.Document.ComponentDefinition.Occurrences

  5. For Each oComp In oComps
  6. If oComp.Suppressed Then
  7. Trace.WriteLine(oComp.Name + " is suppressed")
  8. If Not oComp.IsPatternElement Then         
  9. oComp.Delete
  10. End If
  11. Else
  12. Trace.WriteLine(oComp.Name + " NOT suppressed")
  13. End If
  14. Next