000

Index Labels

iLogic - Suppress Components in all but the Active Level of Detail

.
Issue:
Your assembly has several Level of Detail Representations set up, which works well. The problem is that when you add a new component to the assembly, you have to go to each Level of Detail and suppress the component in order to prevent it from showing up in those existing Level of Detail Representations.



Solution:
Here is an iLogic rule that will suppress any selected components in all of the other LOD's, with the exception of the active LOD.

This allows you to place the component in the assembly with the LOD you want to add the component to set active, then select the component (or components) and run this iLogic rule to remove the component(s) from the other LODs.

This iLogic rule also doesn't suppress the selected components in the standard LODs, such as the "Master" LOD, the "All Content Center Suppressed" LOD, etc.

Note too that it saves the file each time one of the other LODs is modified in order to make the changes "stick", so if you have a large assembly with many LODs it might take a bit for this rule to run.






Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

' Find all selected components and add them to an ObjectCollection.
Dim oSelected As ObjectCollection
oSelected = ThisApplication.TransientObjects. _
CreateObjectCollection (oDoc.SelectSet)

'define LOD rep
Dim oLODRep As LevelOfDetailRepresentation

'define rep manager
Rep_Manager =ThisApplication.ActiveDocument. _
ComponentDefinition.RepresentationsManager

'define an arraylist to hold the list of  LOD rep names
Dim NameList As New ArrayList()

'look at the LOD reps in the assembly
For Each oLODRep in Rep_Manager.LevelOfDetailRepresentations
'add the LOD names to the array list
NameList.add(oLODRep.Name)
Next

Dim myLOD as LevelOfDetailRepresentation
'get the name of the active LOD
myLOD = Rep_Manager.ActiveLevelOfDetailRepresentation

'remove active LOD from list
NameList.remove(myLOD.name)

'remove standard LODs from list
NameList.remove("Master")
NameList.remove("All Components Suppressed")
NameList.remove("All Parts Suppressed")
NameList.remove("All Content Center Suppressed")

'step through the LOD list
'and suppress the selected components
Dim sName as String
For Each sName in NameList
                'Activate the LOD
                Rep_Manager.LevelOfDetailRepresentations(sName).Activate
                For Each oObject in oSelected
                                Try
                        'suppress component
                                Component.IsActive(oObject.Name) = False
                                Catch ' catch any errors
                                End Try
                        Next
            ThisDoc.Save
Next    

'set the original active LOD back to active
Rep_Manager.LevelOfDetailRepresentations(Trim(myLOD.Name)).Activate

Blog Archive

Labels

3D Modeling 3D Sketch Inventor AI Design AI in Manufacturing AI Tools Architecture Artificial Intelligence AutoCAD AutoCAD advice AutoCAD Basics AutoCAD Beginners AutoCAD Civil3D AutoCAD commands AutoCAD efficiency AutoCAD features AutoCAD File Management AutoCAD Layer AutoCAD learning AutoCAD print settings AutoCAD productivity AutoCAD Teaching AutoCAD Techniques AutoCAD tips AutoCAD training. AutoCAD tricks AutoCAD Tutorial AutoCAD workflow AutoCAD Xref Autodesk Autodesk 2025 Autodesk AI Tools Autodesk AutoCAD Autodesk Fusion 360 Autodesk Inventor Autodesk Inventor Frame Generator Autodesk Inventor iLogic Autodesk Recap Autodesk Revit Autodesk Software Autodesk Video Automation Automation Tutorial Basic Commands Basics Beginner Beginner Tips BIM BIM Implementation Block Editor ByLayer CAD comparison CAD Design CAD File Size Reduction CAD line thickness CAD Optimization CAD Productivity CAD software clean CAD file cleaning command Cloud Collaboration command abbreviations Construction Technology Contraints Create resizable blocks CTB STB Data Reference Data Shortcut design software Design Workflow Digital Design Digital Twin Drafting Standards Drawing Automation Dref Dynamic Block Dynamic Block AutoCAD Dynamic Blocks Dynamic doors Dynamic windows eco design editing commands energy efficiency Engineering Engineering Design Engineering Innovation Engineering Technology engineering tools Excel Express Tools External Reference Fast Structural Design Fusion 360 Generative Design green building Grips heavy CAD file Heavy CAD Files iLogic Industry 4.0 Insight Inventor API Inventor Drawing Template Inventor Frame Generator Inventor Graphics Issues Inventor IDW Inventor Tips Keyboard Shortcuts Learn AutoCAD Machine Learning in CAD maintenance command Management Manufacturing Innovation Metal Structure ObjectARX .NET API Organization OVERKILL OVERKILL AutoCAD Palette PDF Plot Style AutoCAD Practice Drawing Printing Quality professional printing Professional Tips PTC Creo PURGE PURGE AutoCAD ReCap reduce CAD file size Resizable Block Revit Revit Best Practices Revit Workflow Ribbon screen shortcut keys Shortcuts Siemens NX Sketch Small Firms Smart Block Smart Factory SolidWorks Steel Structure Design sustainability Sustainable Manufacturing toolbar Tutorial User Interface (UI) Workbook Workspace XLS Xref