CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 1041 
Plex.Earth connects AutoCAD and Google Earth

CAD tip CAD tip # 10071:

Question CAD 
 %  platform  category 
Q - question

How to recolor layers from ACI to truecolor?

A - answer How to change layer colors (ACI) to Truecolors of the same hue? E.g. to change a layer color Red (1) to the RGB color 255,0,0.

You can use the following LISP utility to recolor layers, changing their color method "palette" (ACI) to Truecolor:

; Layer ACI -> truecolor
(defun C:LAY2TC ( / lay truecol aci R G B)
 (vl-load-com)
 (vlax-for lay (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
   (setq truecol (vla-get-truecolor lay))
   (if (= (vla-get-ColorMethod truecol) acColorMethodByACI)
    (progn
      (setq aci (vla-get-ColorIndex truecol))            
      (vla-put-ColorMethod truecol acColorMethodByRGB)
      (vla-put-ColorIndex truecol aci)
      (setq R (vla-get-red truecol))
      (setq G (vla-get-green truecol))
      (setq B (vla-get-blue truecol))
      (vla-setRGB truecol R G B)
      (vla-put-truecolor lay truecol)
    )
   )  
 ); vlax
)

You can download the LAY2TC add-on application from www.cadstudio.cz/download

ACAD
100% *  CAD 
30.10.2014    6661×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 12760:Replace texts with blocks of the same name - Txt2Ref.
Tip 12633:Sol2SolH - convert DWG objects of the type Solid to Hatches
Tip 12392:Export unfolds of sheetmetal parts to DXF - parameters for iLogic and VBA
Tip 12279:PropByLayer - an inverse function to SetByLayer.
Tip 12215:How to change truecolor DWG objects to indexed ACI colors?


Back   All CAD Tips All CAD tips&tricks



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Export 3D VRML scenes from AutoCAD and Inventor
VRMLout More info


Please use these tips at your own risk.
CAD Studio is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist