Get a group by single-point selection

Get a group by single-point selection

Anonymous
Not applicable
283 Views
1 Reply
Message 1 of 2

Get a group by single-point selection

Anonymous
Not applicable
The user can get a group by sngle-point selection on the screen,
i try to do that by programming, it seen like this



ads_name entname;
ads_point ptres;
if((acedEntSel("\nSelect an element:",entname,ptres))!=RTNORM)
return;

AcDbObjectId objId;
AcDbObject *pObj;

acdbGetObjectId(objId,entname);
acdbOpenObject(pObj,objId,AcDb::kForRead);

AcDbVoidPtrArray *pReactors;
pReactors=pObj->reactors();
pObj->close();

void *pSomething;
AcDbObjectIdArray objIds;
AcDbObjectId persObjId;
AcDbObject *pPers;
long lCounter=0;

if (pReactors != NULL && pReactors->length() > 0){
for(int i=0;ilength();i++){
pSomething=pReactors->at(i);
if (acdbIsPersistentReactor(pSomething)){
persObjId=acdbPersistentReactorObjectId(pSomething);
acdbOpenObject(pPers,persObjId,AcDb::kForRead);
if(pPers->isA()==AcDbGroup::desc()){
lCounter++;
objIds.append(acdbPersistentReactorObjectId(pSomething));
}
pPers->close();
}
}
}

is it right ? or it has an easy way to do this, thanks for your reading.
0 Likes
284 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
This is the way I know and I use it without problems.
0 Likes