- 积分
- 937
- 明经币
- 个
- 注册时间
- 2004-12-30
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
void CMainPlate::CreateBlock() { // TODO: Add your control notification handler code here acDocManager->lockDocument(curDoc()); char BlockName[132]; acedGetString(0,"请输入新块名\n",BlockName); AcDbBlockTableRecord *pBRecord=new AcDbBlockTableRecord(); pBRecord->setName(BlockName); AcGePoint3d basept(0,0,0); pBRecord->setOrigin(basept); AcDbBlockTable *pBTable=NULL; acdbHostApplicationServices()->workingDatabase()\ ->getSymbolTable(pBTable,AcDb::kForWrite); AcDbObjectId pBRecordId; pBTable->add(pBRecordId,pBRecord); pBTable->close(); ads_name ssl; acedSSGet(NULL,NULL,NULL,NULL,ssl); long number; acedSSLength(ssl,&number); ads_name ent; for(int i=0;i<number;i++) { acedSSName(ssl,i,ent); AcDbObjectId entId; acdbGetObjectId(entId,ent); AcDbEntity *pEnt; acdbOpenObject(pEnt,entId,AcDb::kForRead); pBRecord->appendAcDbEntity(entId,pEnt); pEnt->close(); } pBRecord->close(); acDocManager->unlockDocument(curDoc()); }
我想把选择集中的实体做成一个块,这段代码编译,链接都没有毛病,可我在插入新建块的时候,却什么也看不到,请高手指点。 |
|