Using iLogic rule to change linework colors in a drawing file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to create a rule that will take any selected linework of an assembly or part file (Edge Priority & Part Priority) in an idw file and change the color of the linework to a specific color.
I currenty have this code which will run, but does not change the color. It doesn't produce any errors so I'm having some trouble diagnosing the issue.
' Get the active document Dim doc As Document = ThisApplication.ActiveDocument ' Check if the document is a drawing If doc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then Dim drawingDoc As DrawingDocument = doc ' Get the selected objects Dim selectedObjects As SelectSet = ThisApplication.ActiveDocument.SelectSet ' Define the new color Dim newColor As Color = ThisApplication.TransientObjects.CreateColor(0, 162, 222) ' Loop through the selected objects and change their color For Each obj In selectedObjects If TypeOf obj Is DrawingCurve Then Dim curve As DrawingCurve = obj ' Change the color of each segment in the curve For Each segment As DrawingCurveSegment In curve.Segments segment.OverrideColor = newColor Next End If Next Else MessageBox.Show("Please open a drawing document.") End If
Thanks in advance!