TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Mark on May 17, 2005, 03:38:40 PM
-
Anyone have a function for these things?
Best I can do in 10 minutes. :)
(defun cMagenta (/ AcCmColor)
;; returns a AcCmColor object set to magenta
(setq AcCmColor
(vla-getinterfaceobject
(vlax-get-acad-object)
"AutoCAD.AcCmColor.16"
)
)
(vla-setRGB AcCmColor '255 '0 '255) ; magenta
AcCmColor
)
-
Depends on the use. If changing the color of an object, you could grab the existing AxCmColor and change that. For example, setting magenta by ACI:
(defun setMagenta (obj / color)
(setq color (vla-get-TrueColor obj))
(vla-put-ColorIndex color acMagenta)
(vla-put-TrueColor obj color)
(vlax-release-object color)
)