- 积分
- 1148
- 明经币
- 个
- 注册时间
- 2004-5-18
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我的例子程序在VC和CAD中都无错运行,但在视图区中没有任何反应,问题出在哪儿!请高手指点:
void ACADcucaodu() { #ifdef OARXWIZDEBUG acutPrintf ("\nOARXWIZDEBUG - ACADcucaodu() called."); #endif // OARXWIZDEBUG // TODO: Implement the command AcDbBlockTableRecord *pbtr=new AcDbBlockTableRecord(); pbtr->setName("YD"); AcGePoint3d basep(0,0,0); pbtr->setOrigin(basep); AcDbBlockTable *pbt; acdbHostApplicationServices()->workingDatabase()->getBlockTable(pbt, AcDb::kForWrite); AcDbObjectId id; pbt->add(id,pbtr); pbt->close(); AcGePoint3dArray ptarr,ptarr1; ptarr.setLogicalLength(4); ptarr[0].set(0,0,0); ptarr[1].set(18,0,0); ptarr[2].set(18,6,0); ptarr[3].set(0,6,0); AcGePoint3d pt1(6,0,0),pt2(6,6,0); AcDb2dPolyline *ppline=new AcDb2dPolyline(AcDb::k2dSimplePoly,ptarr,0,Adesk::kTrue); AcDbLine *pline=new AcDbLine(pt1,pt2); AcGePoint3d center(3,3,0); AcGeVector3d normal(0,0,1); AcDbCircle *pcir=new AcDbCircle(center,normal,1.5); AcDbObjectId plineid; pbtr->appendAcDbEntity(plineid,ppline); pbtr->appendAcDbEntity(pline); pbtr->appendAcDbEntity(pcir); ppline->close(); pline->close(); pcir->close();
AcGePoint3d pt(8,1.5,0); AcDbAttributeDefinition *pattdef=new AcDbAttributeDefinition; pattdef->setPosition(pt); pattdef->setHeight(3); pattdef->setRotation(0); pattdef->setHorizontalMode(AcDb::kTextLeft); pattdef->setVerticalMode(AcDb::kTextBase); pattdef->setPrompt("请输入圆度公差:"); pattdef->setTextString("0.3"); pattdef->setTag("Tag"); pattdef->setInvisible(Adesk::kFalse); pattdef->setVerifiable(Adesk::kFalse); pattdef->setPreset(Adesk::kFalse); pattdef->setConstant(Adesk::kFalse); pbtr->appendAcDbEntity(plineid,pattdef); pattdef->close(); pbtr->close(); pbt->close(); } |
|