Routine to change RGB colors to ACI/Index 255 colors (and the opposite)
Hello Friends I am looking for a routine to change - on ALL objects of the current drawing (entire DWG) OR - on ONLY on a classic AutoCAD selection *** Routine: TO255COLORS Brownse all entities and all blocks and sub-blocks and sub-entities (of th
forums.autodesk.com
(defun C:LAYERCOLORTOINDEX (/ acad doc color2 n1 color1 method1 colorindex)
;;; By 3wood 31/03/2016, Change truecolor layer colors to index colors
(setq acad (vlax-get-acad-object)
doc (vla-get-activedocument acad)
color2 (vla-GetInterfaceObject acad (strcat "AutoCAD.AcCmColor." (substr (vlax-product-key) 28 2)))
)
(vla-startundomark doc)
(vlax-for n1 (vla-get-layers doc)
(setq color1 (vla-get-truecolor n1)
method1 (vla-get-colormethod color1)
colorindex (vla-get-colorindex color1)
)
(if (/= method1 195)
(progn
(vla-put-colorindex color2 colorindex)
(vla-put-truecolor n1 color2)
)
)
)
(vla-endundomark doc)
(princ)
)
'autocad' 카테고리의 다른 글
Parse Numbers; Get string from *TEXT (0) | 2024.12.13 |
---|---|
따옴표를 리습 함수에서 사용하기 (2) | 2024.09.26 |
layouts 폴더에 ExportLayout 저장하기 (0) | 2024.08.13 |
Fix Dimstyles After Revit exporting to Cad (0) | 2024.08.01 |
선택없이 PDF 출력하기 (0) | 2024.07.24 |