明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1198|回复: 1

求助,图块问题!

[复制链接]
发表于 2005-3-21 13:40:00 | 显示全部楼层 |阅读模式
我的例子程序在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();
}
 楼主| 发表于 2005-3-21 14:30:00 | 显示全部楼层
呵呵,我知道是怎么一回事了!!我想问一下,怎么在ARX程序中调用块插入啊?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 07:36 , Processed in 0.160276 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表