Message 1 of 9
Change component color while working in top level assembly.

Not applicable
02-04-2016
10:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
I am trying to write an iLogic code that will allow me to change the color of components while working in the top level of an assembly. I have written a code that allows me to turn off the visibility of certain components in the top level as well as any sub assembly level, so I was hoping that I could just modify that to change the color of the component rather than just hide it, but i'm coming up with no luck. The code that I have for the component visiblity is below, in case anyone knows of how it could potentially be modified for component color.
Any help is greatly appreciated.
Thanks!
SyntaxEditor Code Snippet
' Rule toggles all components visibility
Dim oAsmDef As AssemblyComponentDefinition _
= ThisApplication.ActiveDocument.ComponentDefinition
Dim oList As ComponentOccurrencesEnumerator = oAsmDef.Occurrences.AllLeafOccurrences
For Each oOcc As ComponentOccurrence In oList
'Get the browser name of the component
oOccName = oOcc.Name
'Check if the desired bit of text is in the component's name
If InStr(oOccName, "Component") > 0 Then
If oOcc.Visible = False Then
oOcc.Visible = False
Else
End If
End If
Next