Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How you know Autocad color index number for any object?

user-image
Question added by hamza sirri , Senior Draughtsman , ALTERATH ENGINEERING CONSULTANTS
Date Posted: 2016/05/19
Vaqar Ali Sayyed
by Vaqar Ali Sayyed , AutoCad Opertator , Carlo Gavaazzi Arabia Co. Ltd.

You can determine the entity’s color by using the colorIndex() method. This method would return the AutoCAD color number of the entity. An entity’s color could also be either BYBLOCK or BYLAYER apart from the actual color values. If the entity has any of these two values for color then the color of the entity is dependent on the block reference’s color or the entity’s layer color as the case may be.

If the entity is in a block then, note that it is the block references (AcDbBlockReference objects) which have the color and this is the color with which entities will appear if they have the color BYBLOCK. For entities which are nested deep in block references the solution is to traverse through the AcDbBlockReference objects using the resbuf returned by the acedNEntSel() function. The function acedNEntSel will return the parent block reference which the actual selected entity is part of. It also returns all the parent block references if the original block reference is nested. If the selected entity has color BYBLOCK, you need to query the parent block references up the order till you find a block reference whose color is *not* BYBLOCK or it does not have any more parent(which means the block reference is in Model Space). The sample code below shows how to implement the above.

Dear All Please Vote for Question as well as best Answer.

Adrian Rimniceanu
by Adrian Rimniceanu , Technical Manager , Alcoda S.R.L

The following options are displayed for Autocad Index Color Tab:

AutoCAD Color Index (ACI) Palettes

Specifies a color from the AutoCAD Color Index. If you hover over a color, the number of the color and its red, green, blue value are displayed below the palette. Click a color to select it, or enter the color number or name in the Color box.

The large palette displays colors 10 through 249.

The second palette displays colors 1 through 9; these colors have names as well as numbers.

The third palette displays colors 250 through 255; these colors are shades of gray.

Index Color

Indicates the ACI color number when you hover over a color.

Red, Green, Blue

Indicates the RGB color value when you hover over a color.

Bylayer

Specifies that new objects assume the color assigned to the layer on which you create them. When BYLAYER is selected, the color of the current layer is displayed in the Old and New color swatches.

Byblock

Specifies that new objects use the default color (white or black, depending on your background color) until you group the objects into a block and insert the block. When you insert the block into a drawing, the objects in the block inherit the current Color setting.

Color

Specifies a color name, BYLAYER or BYBLOCK color, or an AutoCAD Color Index (ACI) number of 1 through 255. The New color swatch shows the most recently selected color.

Old Color Swatch

Displays the previously selected color.

New Color Swatch

Displays the currently selected color. 

Amr Gamal Anwar Hassan
by Amr Gamal Anwar Hassan , مهندس حاسب كميات , Shurfah Real Estate Development and Investment

I agree with all expert answers

Ghada Eweda
by Ghada Eweda , Medical sales hospital representative , Pfizer pharmaceutical Plc.

A good answer given by Mr.Vaqar Ali Sayyed  and Mr.Adrian Rimniceanu . Thank you 

 

I apologize for the answer , I leave the answer to the specialists the experts in this the field , that's not  The area of my specialty .

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.