AcDbBlockTableRecord *pNewBlock=new AcDbBlockTableRecord(); pNewBlock->setName("newblock");
AcDbBlockTable *pT; acdbHostApplicationServices()->workingDatabase()->getSymboltable(pT,AcDb::kForWrite);
pT->add(pNewBlock); pT->close();
AcDbLine *pL=new AcDbLine(); pL->setStartPoint(AcGePoint3d(100,100,0)); pL->setEndPoint(AcGePoint3d(400,100,0)); pNewBlock->appendAcDbEntity(pL);
pL->close(); pNewBlock->close();
以上代码创建了一个名为newblock的块,块中画了一条直线,上述代码编译后(arx动态库)在AutoCAD2002中加载后,运行,在autocad中新块确实产生了,然而没有直线显示出来,这个块好象是一个创建后又被删除等待purge的那种块,请问这是什么原因? |