- UID
- 216913
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-2-10
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
void InsertBlock(ads_point basePoint,double angle)
{
AcDbDatabase *pDwg =new AcDbDatabase (Adesk::kFalse) ;
Acad::ErrorStatus es;
es=pDwg->readDwgFile ("C:\\ccd.dwg") ; //C盘是有这个文件的
if(es==Acad::eOk)
{
AfxMessageBox("readDwgFile Successful!");
}
AcDbObjectId blockId ;
es = acdbHostApplicationServices()->workingDatabase()->insert (blockId, "myfile", pDwg,
Adesk::kFalse) ;
if ( es != Acad::eOk )
acutPrintf ("\n插入块错误.") ;
delete pDwg ;
AcDbBlockTableRecord”,
AcDbBlockReference对象,
AcDbBlockReference *pBlkRef =new AcDbBlockReference ;
pBlkRef->setBlockTableRecord (blockId) ;
AcGePoint3d inbase(basePoint[X], basePoint[Y], 0.0);
pBlkRef->setPosition (inbase) ;
pBlkRef->setRotation (0.0) ;
pBlkRef->setScaleFactors(AcGeScale3d(1,1,1));
AcDbBlockTable *pBlockTable ;
acdbHostApplicationServices()->workingDatabase()->getBlockTable (pBlockTable, AcDb::kForRead) ;
AcDbBlockTableRecord *pBlockTableRecord ;
pBlockTable->getAt (ACDB_MODEL_SPACE, pBlockTableRecord,
AcDb::kForWrite) ;
pBlockTable->close () ;
AcDbObjectId newEntld;
pBlockTableRecord->appendAcDbEntity(newEntld,pBlkRef);
pBlockTableRecord->close();
pBlkRef->close();
}
为何调用该函数,所插入的块显示不出来的!问题出在那里!
谢谢 |
|