I designed a custom entity which has an AcDbEntity* member. If I set the color on my custom entity, the member entity is drawn in that color if it is a polyline, but if it is a region, the color stays on "by-layer". Does this make sense? Why the difference?
// -----------------------------------------------------------------------------------------
///
<sumary> Provides rendering instructions. </summary>
/// -----------------------------------------------------------------------------------------
Adesk::Boolean Element::subWorldDraw(AcGiWorldDraw* dc)
{
AcGiDrawable* drawable = static_cast<AcGiDrawable*>(_primitive);
if(drawable)
{
dc->geometry().pushModelTransform(Translation());
drawable->worldDraw(dc);
dc->geometry().popModelTransform();
}
return Adesk::kTrue;
}
It sounds like the region sets a color before drawing, and the polyline does not. This is not unusual, as there is no rule about whether an entity must or can set a color before drawing. Presumably you can set the region's color so that it draws whatever color you want.