- UID
- 5126
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-5-16
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
我用attachAnnotation(TextID)实现LEADER with annotation(MTEXT)时,Leader本身没什么问题,但是MTEXT却无法attach.
测试代码如下:
AcGePoint3d P1(100,100,0);
AcGeVector3d P2(200,200,0);
AcGePoint3d P3(300,200,0);
AcGePoint3d P4(150,300,0);
int i = 0;
AcDbObjectId TextID;
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()
->getSymbolTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE,
pBlockTableRecord, AcDb::kForWrite);
pBlockTable->close();
AcDbLeader* Leader= new AcDbLeader();
AcDbMText *MText1=new AcDbMText();
AcGePlane plane1();
MText1->setLocation(P3);
MText1->setContents("xxxxx");
MText1->close();
pBlockTableRecord->appendAcDbEntity (TextID,MText1);
i = Leader->attachAnnotation(TextID);
if(i != Acad::eOk);//出错i = 3
{
Leader->close();
return;
}
.................
pBlockTableRecord->close();
其中i始终为3(错误:eInvalidInput),实际上MTEXT是可以正确显示的,即MTEXT是无问题的.
问题幼稚了些,请诸位大虾多多指教. |
|