Hi Nirit,
Am stuck in the same problem. Was wondering if you got any solution for the same?
I am using acedSSGet(_T("A"), NULL, NULL, NULL, nameOfSelectionSet); to get everything in the selectionSet.
Then accessing it by
for(long cnt = 0; cnt < lengthOfSelectionSet; cnt++)
{
acedSSName(nameOfSelectionSet, cnt, nameOfEntity);
acdbGetObjectId(idOfEntity, nameOfEntity); // Here it does not return the id
}
Thanks for your reply Nick,
What points do pointList represent?
What I am trying to do is, access all the entities in the current drawing, when the user runs a particular ObjectArx program and then do some changes in the Block References.
Do you think of any other way to achieve the same.
Thanks
this variant is for selecting entities within a polygon
if(acedSSGet(_T("_cp"), pointlist, NULL, &lookAt, ent) != RTNORM)
if you want to select everything for curret space, your code have to be
if(acedSSGet(_T("_a"), NULL, NULL, &lookAt, ent) != RTNORM)
PS: don't forget, that all of needed elements MUST be visible on the screen. so, you need to "zoom all" before using acedSSGet
Hi,
Another approach is to loop on entities in current space block table record. Are you really needed acedSSGet?
Here's a small example (for Model Space) :
Acad::ErrorStatus es; //get model space block AcDbBlockTableRecordPointer pBlockTableRecord(ACDB_MODEL_SPACE, m_pDatabase, AcDb::kForRead); if((es = pBlockTableRecord.openStatus()) == Acad::eOk) { //loop on each entities in model space AcDbBlockTableRecordIterator * pIterator = NULL; if((es = pBlockTableRecord->newIterator(pIterator)) == Acad::eOk) { for(pIterator->start(); !pIterator->done(); pIterator->step()) { if((es = pIterator->getEntityId(entityId)) != Acad::eOk) continue; //... } delete pIterator; } }
Regards,
Hey Jonathan,
Thanks for your reply.
While using acedSSGet(); I was having some difficulty to get the exact Entity Id, So I did go ahead and implement the Model Space approach instead of Selection Set.
Was just curious to know, if there was something missed while using acedssGet, since it would make things simple, as it would a single line code.
Appreciate your help Jonathan.