- 积分
- 12459
- 明经币
- 个
- 注册时间
- 2003-5-28
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-10-2 21:54:00
|
显示全部楼层
回复
选择一个实体,删除Group:
ads_name ent; AcDbObjectId objId; int ret; ads_point pt;
ret = acedEntSel("\n请选择一个组实体:", ent, pt); acdbGetObjectId(objId, ent); AcDbObjectPointer <AcDbEntity> pEnt (objId, AcDb::kForRead );
CString strGrpName;
//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); pEnt->close(); AcDbObjectPointer<AcDbGroup> pGroup(rId, AcDb::kForWrite ); strGrpName = pGroup->name(); //得到组名(在这里没什么用) pGroup->erase(); } } }
acedAlert("ok");
assert(strGrpName != NULL); |
|