|
发表于 2002-9-6 09:42:00
|
显示全部楼层
void createGroup(char* pGroupName)
{
AcDbGroup *pGroup = new AcDbGroup(pGroupName);
...//用pGroup->append( AcDbObjectId objId);函数将对象添加到组中
AcDbDictionary *pGroupDict;
acdbHostApplicationServices()->workingDatabase()
->getGroupDictionary(pGroupDict, AcDb::kForWrite);
AcDbObjectId pGroupId;
//添加组名为pGroupName的组对象pGroup到当前组词典中,组对象ID为pGroupId
pGroupDict->setAt(pGroupName, pGroup, pGroupId);
pGroupDict->close(); //千万不要忘记关闭对象,释放内存
pGroup->close();
} |
|