Is there a tool or easy methodology for converting a certain layer color to another color choice? We have had to change our pen settings to adapt more closely with NCS guidance and have legacy drawings which utilize colors with new weights. I need something which says "color 256 become color 8" etc I have about 15 colors which were affected: 8830 pen setting 510 pen setting 11 8 14 31 15 8 17 8 21 8 25 38 30 8 53 8 62 8 81 8 82 8 122 8 126 8 153 8 164 8 211 118 I am only concerned about "bylayer" color choices - if that matters. -- Thank you in advance, Paul S. Sheehan, CD, Assoc. AIA CAD Systems Manager CMSS Architects, PC 4505 Columbus Street, Suite 100 Virginia Beach, Virginia 23462 Voice: 757.222.2010 Fax: 757.222.2022 www.cmssarchitects.com
You're posting to the wrong ng, Paul. This should be in basic AutoCAD. If everything now is bylayer, either change the layer's colors, generate a new ctb file, use the CAD Standards components, etc. Nothing in your post suggests that you need a programming task. -- Mike ___________________________ Mike Tuersley CADalyst's CAD Clinic Rand IMAGINiT Technologies ___________________________ the trick is to realize that there is no spoon...
Layers have a colour property, which can easily be amended via VBA. You could go through the layer collection using a simple routine along the lines of public sub changelayercolour() dim layers as acadlayers dim layer as acadlayer dim colour as acColor set layers = thisdrawing.layers For each layer in layers colour = layer.color select case colour case = acYellow then layer.color = acWhite case = ...... end select next end sub This is off the top of my head and without looking at the help so there are likely to be mistakes, so I would suggest looking at the ActiveX/VBA help as well.
Hi, This may not work in 2004 based drawings. You need to look at the new colouring system. for 2004 based drawings. There is good sample code in the help files. -- Regards, Laurie Comerford www.cadapps.com.au
Correct Laurie, 2004 is different. I'd only just been looking yesterday at something colour related for 2005, and that was what was in my head without considerations of any differences. The original post didn't specify so hopefully it will be of some help anyway. Tested example routine for 2005 only follows, amended to fix the bugs. Public Sub changelayercolour() Dim layers As AcadLayers Dim layer As AcadLayer Dim colour As AcColor Set layers = ThisDrawing.layers For Each layer In layers colour = layer.color Select Case colour Case acYellow layer.color = acWhite Case acCyan layer.color = acBlue End Select Next End Sub