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

Regarding ACDBGroup

1 REPLY 1
Reply
Message 1 of 2
jignesh.rana
271 Views, 1 Reply

Regarding ACDBGroup

Hi,

 

       i made Group of Entities with group name is _BlockLayout using AcDbGroup now i want to get this group with acutbuildlist and move it from one location to another 

 

   how to do it , any idea ?

1 REPLY 1
Message 2 of 2
tbrammer
in reply to: jignesh.rana

You have to get all AcDbEntitys within the AcDbGroup and move them individually. The most effective way is to do it like this:

void MoveAllEntitiesInGroup(const AcDbGroup *pMyGroup, AcGeVector3d vOffset)  {
	Acad::ErrorStatus es;
	AcDbObjectIdArray ids;
	pMyGroup->allEntityIds(ids);
	AcDbEntity *pEnt;
	AcGeMatrix3d mat;
	mat.setToTranslation(vOffset);
	for (const AcDbObjectId &id : ids) 	{
		if ( (es=acdbOpenObject(pEnt, id, AcDb::kForWrite)) == Acad::eOk ) {
			es = pEnt->transformBy(mat);
			pEnt->close();
		}		
	}
}

 If you insist on using a resbuf list you can use 

Acad::ErrorStatus acdbGetAdsName(ads_name& objName, AcDbObjectId objId);

to get the ads_names. of the AcDbObjectIds within ids. Than you can and either append them to the resbuf list or build a selectionset.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

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

Post to forums  

Forma Design Contest


AutoCAD Beta