使用颜色
 
 

You can assign a color to an individual object in a drawing using its Color or ColorIndex property. The ColorIndex property accepts an AutoCAD Color Index (ACI) value as a numeric value of 0 - 256. The Color property is used to assign an ACI number, true color, or color book color to an object. To change the value of the Color property, you use the Color object which is under the Colors namespace.

用户可以使用对象的 ColorColorIndex 属性为图形中的单独对象指定颜色。 ColorIndex 属性接受一个数值从 0 到 256 的AutoCAD 颜色索引(ACI)值。Color 属性通常用于指定一个 ACI 编号,真彩色或命名颜色给一个对象。若要修改 Color 属性的值,请使用 Colors 命名空间下的 Color 对象。

The Color object has a SetRGB method which allows you to choose from millions of color combinations based on mixing a red, green and blue color value together. The Color object also contains methods and properties for specifying color names, color books, color indexes, and color values.

Color 对象有 SetRGB 方法允许你从基于红、绿和蓝色之间相互混合组成的数百万种颜色中挑选颜色。Color 对象也包含从指定颜色名字、颜色簿、颜色索引和颜色值获得颜色的方法和属性。

You can also assign colors to layers. If you want an object to inherit the color of the layer it is on, set the object’s color to ByLayer by setting its ACI value to 256. Any number of objects and layers can have the same color number. You can assign each color number to a different pen on a pen plotter or use the color numbers to identify certain objects in the drawing, even though you cannot see the colors on your screen.

用户也可以为图层指定颜色。如果想让对象从图层中继承颜色,请设置对象的颜色为 ByLayer ,或通过设置它的 ACI 值为 256。任意数量的对象和图层都可以具有同一颜色编号。尽管在屏幕上看不到颜色,用户还是可以指定笔式绘图仪上的各种笔使用不同的颜色编号,或者使用颜色编号来标识图形中的特定对象。

For more information about working with colors, see “Work with Colors” in the AutoCAD User's Guide.

更多关于操作颜色的详细信息,请参见《AutoCAD 用户手册》中的“操作颜色”。