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:
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:
All suggestions are welcomed.
Regards,
Jonathan
Have you tried calling highlight() multiple times without closing and re-opening the entity?
Yes I tried (I hoped it was the solution). Only the last call to highlight has effect.
Hello,
This blog post might be helpful.
Sub-entities that are associated with a selected dimension are highlighted.
Can't find what you're looking for? Ask the community or share your knowledge.