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

How highlight multiple edges of a (custom) entity?

3 REPLIES 3
Reply
Message 1 of 4
maisoui
395 Views, 3 Replies

How highlight multiple edges of a (custom) entity?

Hi,

 

I'd like to reproduce 'remove points' feature of mleader for my custom entity, and I'm looking for how highlight multiple edges. I found a lot of example on how highlight one segment or edge of an entity but none for multiple.

 

A small picture to illustrate what I'd like to do:

highlight_multiple_edges.png

 

Here the code I used (found on ADN or in forums):

hightlightEdge(const AcDbObjectId & objId, const int iMarker) const
{

Acad::ErrorStatus es; //open entity AcDbEntity * pEntity; if((es = acdbOpenAcDbEntity(pEntity, objId, AcDb::kForRead)) != Acad::eOk) return; //get the subentity ID for the edge that is picked AcGePoint3d pickpnt; AcGeMatrix3d mx; int iNumIds; AcDbFullSubentPath * pSubentIds; if((es = pEntity->getSubentPathsAtGsMarker(AcDb::kEdgeSubentType, iMarker, pickpnt, mx, iNumIds, pSubentIds)) == Acad::eOk) { // At this point the subentId's variable contains the // address of an array of AcDbFullSubentPath objects. // The array should be one element long, so the picked // edge's AcDbFullSubentPath is in subentIds[0]. // // For objects with no edges (such as a sphere), the // code to highlight an edge is meaningless and must // be skipped. // if(iNumIds > 0) { Acad::ErrorStatus es = pEntity->highlight(pSubentIds[0]); assert(es == Acad::eOk); } delete [] pSubentIds; } pEntity->close();

}

remark:

  • I defined all necessary methods in my custom entity (subGetSubentPathsAtGsMarker, subHighlight, subUnhighlight).
  • It works very well for one segment (but every time I call my method hightlightEdge, it clears the previous highlighted edge)

All suggestions are welcomed.

Regards,

Jonathan

 

--
Jonathan
3 REPLIES 3
Message 2 of 4
owenwengerd
in reply to: maisoui

Have you tried calling highlight() multiple times without closing and re-opening the entity?

--
Owen Wengerd
ManuSoft
Message 3 of 4
maisoui
in reply to: owenwengerd

Yes I tried (I hoped it was the solution). Only the last call to highlight has effect.

--
Jonathan
Message 4 of 4
Balaji_Ram
in reply to: maisoui

Hello,

 

This blog post might be helpful.

 

http://adndevblog.typepad.com/autocad/2012/06/get-the-entitiessubentitiesgeometry-an-associative-dim...

 

Sub-entities that are associated with a selected dimension are highlighted.

 



Balaji
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report

”Boost