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

how to get group name through an entity

1 REPLY 1
Reply
Message 1 of 2
Anonymous
218 Views, 1 Reply

how to get group name through an entity

if an entity is one element of one group, i wnoder if i can get the name of
group through this entity and how to do this.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

"cdlee" wrote in message
news:0F06A6E097AA11A2DAFB1AF5EAD7CA30@in.WebX.maYIadrTaRb...
> if an entity is one element of one group, i wnoder if i can get the name
of
> group through this entity and how to do this.
>

// Fills in second argument with the objectids of
// the dictionary entries of all groups to which
// the AcDbEntity belongs.

int GetGroups(AcDbEntity* pEnt, AcDbObjectIdArray& ids)
{
assert( pEnt != NULL );
AcDbVoidPtrArray* pReactors = pEnt->reactors();
if( pReactors != NULL )
{
for( int i = 0; i < pReactors->length(); i++ )
{
void* pV = pReactors->at(i);
if( pV != NULL && acdbIsPersistentReactor(pV) )
{
AcDbObjectId rId = acdbPersistentReactorObjectId(pV);
AcDbObjectPointer pGroup(rId, AcDb::kForRead);
if( pGroup.openStatus() == Acad::eOk )
ids.append(rId);
}
}
}
return ids.length();
}

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

Post to forums  

Autodesk Design & Make Report

”Boost