|
- static void MyGroupMyCommand7() {
- // Put your command code here
- acutPrintf(TEXT("\nHello world! make groupname"));
-
- MyGroupMyCommand6();
- // 创建带组名实体,并删除指定组名实体
- //提示用户选择多个实体
- TCHAR* prompts[2] = { 采用T("\n请选择实体"),采用T("删掉一个实体") };
- ads采用name ss;
- if (RTNORM != acedSSGet(采用T(":$"), prompts, NULL, NULL, ss))
- return;
-
- Adesk::Int32 lLen;
- acedSSLength(ss, &lLen);
- AcDbObjectId id;
- AcDbGroup* pGroup = new AcDbGroup;
- for (Adesk::Int32 i = 0; i < lLen; i++)
- {
- ads采用name ent;
- if (RTNORM == acedSSName(ss, i, ent))
- {
- if (Acad::eOk == acdbGetObjectId(id, ent))
- {
- pGroup->append(id);
- }
- }
- }
-
- AcDbDictionary* pGroupDict = NULL;
- acdbHostApplicationServices()->workingDatabase()->getGroupDictionary(pGroupDict, AcDb::kForWrite);
- // 提示用户输入group的名称
- TCHAR sGroupName[40];
- if (acedGetString(NULL, TEXT("\n输入用户坐标系的名称:"), sGroupName) != RTNORM)
- return;
-
- CString sGroupName = 采用T("test2"); //匿名组的名称为“*”
- AcDbObjectId idGroup;
- Acad::ErrorStatus es;
- es = pGroupDict->setAt(sGroupName, pGroup, idGroup);
- pGroup->close();
- pGroupDict->close();
- }
复制代码 |
|