Message 1 of 2
Change Model Colors
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am currently trying to make an external rule to change the color scheme of a drawing so I can effectively have a "dark mode" to use while I'm working, but then am able to change it back to the default colors when I'm done. I've found how to change balloons, text, and dimensions, but am struggling to find a way to change the color of model lines in drawing views. Currently this is what I have:
Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument Dim oSheetSettings As SheetSettings oSheetSettings = oDoc.SheetSettings Dim oColor As Color 'oColor = ThisApplication.TransientObjects.CreateColor(237, 237, 214) oColor = ThisApplication.TransientObjects.CreateColor(50, 50, 50) Dim oDim As DrawingDimension oDim = oDoc.ActiveSheet.DrawingDimensions.Item(1) oSheetSettings.SheetColor = oColor 'oColor = ThisApplication.TransientObjects.CreateColor(0, 0, 0) oColor = ThisApplication.TransientObjects.CreateColor(255, 255, 255) oDim.Text.Color = oColor oDim.Layer.Color = oColor Dim oNewLayer As Layer oNewLayer = oDoc.StylesManager.Layers.Item(1) oNewLayer.LineType = LineTypeEnum.kContinuousLineType oNewLayer.Color = oColor Dim oStyles As DrawingStylesManager oStyles = oDoc.StylesManager Dim oSheet As Sheet Dim oBalloon As Balloon For Each oSheet In oDoc.Sheets 'change ballons For Each oBalloon In oSheet.Balloons 'oBalloon.Style = oStyles.BalloonStyles.Item("DC-STD_Balloon") oBalloon.Layer.Color = oColor Next ' Iterate over all dimensions in the drawing and change style For Each oDim In oSheet.DrawingDimensions 'oDrawingDim.Style = oStyles.DimensionStyle.Item("DC-STD_Dim") oDim.Layer.Color = oColor Next Next