Author Topic: AcCmColor objects  (Read 2204 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
AcCmColor objects
« on: May 17, 2005, 03:38:40 PM »
Anyone have a function for these things?

Best I can do in 10 minutes. :)
Code: [Select]

(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

)
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
AcCmColor objects
« Reply #1 on: May 17, 2005, 06:47:48 PM »
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:
Code: [Select]
(defun setMagenta (obj / color)
  (setq color (vla-get-TrueColor obj))
  (vla-put-ColorIndex color acMagenta)
  (vla-put-TrueColor obj color)
  (vlax-release-object color)
)