Changing an Objects Color Properties

The AcCmColor object represents colors. Use the AcCmColor object to set colors and perform other color-related operations on objects. This object belongs to the AutoCAD class AcadAcCmColor. Invoke this class using one of these two methods:

• GetInterfaceObject ("AutoCAD.AcCmColor.16")

• Dim col As New AcadAcCmColor

The object includes properties for colors, color names, color-book names, and the color index. The following example shows how to invoke the SetColorBook method to use Pantone color books on a Circle entity.

Dim fColor As AcadAcCmColor

Set fColor = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")

Call fColor.SetColorBookColor("PANTONE Yellow", _

"Pantone solid colors-uncoated.acb") objCircle.TrueColor = fColor

The AutoCAD 2004 developer's documentation gives more examples for using the AcCmColor object.

0 -1

Post a comment