Hi,
I use an AcDbSolid as AcGiDrawable in the call geometry.draw() in the wordlDraw function of a custom entity.
Here the part of the code inside worldDraw:
AcDbSolid* pSolid = new AcDbSolid();
//draw the solid
//calculate the transformation matrix xForm
//pSolid is managed outside the custom entity, the lifetime is longer then the custom entity itsself
//pSolid can used in more than one entity
mode->geometry().pushModelTransform(xForm);
mode->geometry().draw(pSolid);
mode->geometry().popModelTransform();
I have also overridden the function setAttributes in my custom entity. There I set to kDrawableIsCompoundObject:
Adesk::UInt32 MyEntity::subSetAttributes (AcGiDrawableTraits *traits)
{
assertReadEnabled ();
Adesk::UInt32 ret = AcDbEntity::subSetAttributes (traits);
return ret | kDrawableIsCompoundObject;
}
And most is fine. I see the solid as graphical representation of my entity.
But I can't change the color of my entity. If I choose a new color in the property window the entity keeps the color of the layer. Only if I move the entity to a layer with another color the color of the entity changes too.
What do I do wrong?
Regards,
Marco
Solved! Go to Solution.
Solved by owenwengerd. Go to Solution.
I found a solution. I don't know if it's right, but it seems to work.
I set the the color of the AcDb3dSolid to ByBlock (ColorIndex = 0). It's like when you define a block definition where you want to change the color of the entities inside by the settings of the block reference.
If there is a better solution, reply please.
Regards, Marco
Can't find what you're looking for? Ask the community or share your knowledge.