ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AcDbPolyline vs AcDbRegion in custom entity.

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
5914 Views, 3 Replies

AcDbPolyline vs AcDbRegion in custom entity.

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;

}

 

 

3 REPLIES 3
Message 2 of 4
owenwengerd
in reply to: Anonymous

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.

--
Owen Wengerd
ManuSoft
Message 3 of 4
loic.jourdan
in reply to: Anonymous

Hi,
Have you overriden AcDbEntity::subSetAttributes method (calling embedded _primitive->setAttributes(pTraits) )?
----
20-20 CAD / 20-20 Technologies
Message 4 of 4
Anonymous
in reply to: loic.jourdan

I did, and it didn't seem to make any difference. I could override setColorIndex(...) I guess...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost