去评论
距米网-精简版

使用iLogic抑制装配体中的零件

JUMU
2021/06/17 21:58:19
Setting the Level of Detail with iLogic

iLogic requires a custom Level of Detail (LoD) before it can perform an operation that suppresses a component. If a custom LoD is not active or one does not exist you will get an error message. I get a lot of enquires about this dialog box and how one can avoid the hassle.

First create a rule called “LoD” and populate with the following code:

  1. Dim doc as AssemblyDocument = ThisDoc.Document
  2. Dim oLOD As LevelOfDetailRepresentation
  3. Dim oAsmCompDef As ComponentDefinition
  4. oAsmCompDef = doc.ComponentDefinition

  5. Try
  6.    oLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("iLogic").Activate(True)
  7. Catch

  8.    Dim nLOD As LevelOfDetailRepresentation
  9.    nLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Add("iLogic")
  10.    oLOD = nLOD
  11. Finally
  12.    oLOD = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item("iLogic").Activate(True)
  13. End Try