|
组旋转
void CMyDatabase::rotationGroup(CString strGroupName ,CReiPoint ptRotation,double rotationAngle)
{
AcGePoint3d pt;
AcDbDictionary *pGroupDict;
acdbCurDwg()->getGroupDictionary(pGroupDict,AcDb::kForWrite);
AcDbObjectId groupId;
AcDbGroup *pGroup;
pt.x=ptRotation.x;
pt.y=ptRotation.y;
pt.z=ptRotation.z;
if(pGroupDict->getAt(strGroupName,groupId)==Acad::eOk)
acdbOpenObject(pGroup,groupId,AcDb::kForWrite);
else
{
pGroupDict->close();
return;
}
pGroupDict->close();
AcDbGroupIterator* pIter=pGroup->newIterator();
AcDbEntity* pEnt;
AcDbObjectId objId;
pIter=pGroup->newIterator();
for(;!pIter->done();pIter->next())
{
ōbjId=pIter->objectId();
acdbOpenAcDbEntity(pEnt,objId,AcDb::kForWrite);
rotationEntity(pEnt,pt,rotationAngle);
pEnt->close();
}
delete pIter;
pGroup->close();
} |
|