Message 1 of 9

Not applicable
06-25-2016
08:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
All,
I am working on an iLogic rule to change the color of a sub assembly component while working in a top level asy. This component could be 2 or 3 levels deep. I have been able to successfully turn the visibility on or off for the component through all of the sub assemblies, but when I use a similar code to just change the component color, it doesn't work. It is only changing the color if that component is in the top level. Below is the code that I am working with. 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, "80299") > 0 Then
If oOcc.Visible = True Then
Component.Color(oOccName) = "Yellow (Clear)"
Else
End If
End If
Next
Solved! Go to Solution.