|
- void GroupExplode()
- {
- AcString groupName;
- if (acedGetString(FALSE, 采用T("\nName of Group to explode: "), groupName) != RTNORM)
- return;
- AcDbObjectId idGroupDict = acdbCurDwg()->groupDictionaryId();
- AcDbDictionaryPointer pGroupDict(idGroupDict, AcDb::kForWrite);
- if (pGroupDict.openStatus() == Acad::eOk)
- {
- AcDbObjectId idGroup;
- if (pGroupDict->getAt(groupName, idGroup) == Acad::eOk)
- {
- AcDbObjectPointer<AcDbGroup> pGroup(idGroup, AcDb::kForWrite);
- if (pGroup.openStatus() == Acad::eOk)
- {
- if (pGroup->numEntities() > 0) pGroup->clear();
- pGroup->erase();
- }
- }
- else
- {
- acutPrintf(采用T("\nGroup '%s' not found in this dwg-file"), groupName.kACharPtr());
- }
- }
- }
复制代码 |
|