Suppress placed component in non-active levels of detail and one specified LOD.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I found an iLogic rule that suppresses a placed component in all LOD's not currently in use. This is verry close to what I need but not quite. I want to be able to specify one other LOD to show the component. I could then tweak the code for each component type to show in the LOD its needed in.
We typically do our modeling in Master ISO LOD instead of switching back and forth between LOD's, so this rule does not work for us as is.
Example: If I add this rule to a wall panel and place the panel in the master ISO LOD it needs to show in Master ISO LOD and it also needs to show in the wall's layout LOD but none of the others.
Is there a way for me to add a section in the code that lets me specify an LOD to be left out of the suppression?
Here is what I have to start with:
' Suppress in non-active levels.
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