Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
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.
The following options are displayed for Autocad Index Color Tab:
AutoCAD Color Index (ACI) PalettesSpecifies 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 ColorIndicates the ACI color number when you hover over a color.
Red, Green, BlueIndicates the RGB color value when you hover over a color.
BylayerSpecifies 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.
ByblockSpecifies 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.
ColorSpecifies 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 SwatchDisplays the previously selected color.
New Color SwatchDisplays the currently selected color.
I agree with all expert answers
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 .