iLogic component edge color in IDW view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is there code for changing the color (or other properties) of the visible edges of a component in a drawing view, the same way I can do it manually by right-clicking a component and choosing Properties?
I wrote this rule to change the color of each individual drawing curve:
Edit: Ignore the "<!". It's the only way I could get the iLogic code to successfully post in the message
For Each drawViews In ThisApplication.ActiveDocument.ActiveSheet.DrawingViews
occ3 = drawViews.ReferencedDocumentDescriptor.ReferencedDocument.ComponentDefinition.Occurrences.ItemByName("GF_Plenum:1")
Dim newColor3 As Color
newColor3 = ThisApplication.TransientObjects.CreateColor(0,255,255)
Dim drawcurves3 As DrawingCurvesEnumerator
drawcurves3 = drawViews.DrawingCurves(occ3)
Dim drawCurve3 As DrawingCurve
For Each drawCurve3 In drawcurves3
drawCurve3.Color() = newColor3
Next
Next
However, the problem with this rule is that it selects each of the drawing curves and individually sets the color property. For a drawing of a small assembly, this would work fine. But I have a medium-to-large assembly, and when the rule gets to a certain view, it takes FOREVER to run through this rule. If I manually set the component properties (rather than the edge properties), it only takes a fraction of a second.
How do I write code to do what I can manually do? Just to be clear, there are a few ways to set the properties of a component in a drawing view. One is to select each of the edges individually and apply the properties. Another is to select the component in the browser, right-click, choose "Select as Edges", and then apply properties. And yet another is to select the component in the browser, right-click and choose Properties (see attached image). I would like to do this last one with code.
Any iLogic or VBA gurus out there know how to do this?