bai_cai101 发表于 2005-3-21 13:40:00

求助,图块问题!

我的例子程序在VC和CAD中都无错运行,但在视图区中没有任何反应,问题出在哪儿!请高手指点:


void ACADcucaodu()<BR>{<BR>#ifdef OARXWIZDEBUG<BR>        acutPrintf ("\nOARXWIZDEBUG - ACADcucaodu() called.");<BR>#endif // OARXWIZDEBUG<BR>        // TODO: Implement the command<BR>        AcDbBlockTableRecord *pbtr=new AcDbBlockTableRecord();<BR>        pbtr-&gt;setName("YD");<BR>        AcGePoint3d basep(0,0,0);<BR>        pbtr-&gt;setOrigin(basep);<BR>        AcDbBlockTable *pbt;<BR>        acdbHostApplicationServices()-&gt;workingDatabase()-&gt;getBlockTable(pbt, AcDb::kForWrite);<BR>        AcDbObjectId id;<BR>        pbt-&gt;add(id,pbtr);<BR>        pbt-&gt;close();<BR>        AcGePoint3dArray ptarr,ptarr1;<BR>        ptarr.setLogicalLength(4);<BR>        ptarr.set(0,0,0);<BR>        ptarr.set(18,0,0);<BR>        ptarr.set(18,6,0);<BR>        ptarr.set(0,6,0);<BR>        AcGePoint3d pt1(6,0,0),pt2(6,6,0);<BR>        AcDb2dPolyline *ppline=new AcDb2dPolyline(AcDb::k2dSimplePoly,ptarr,0,Adesk::kTrue);<BR>        AcDbLine *pline=new AcDbLine(pt1,pt2);<BR>        AcGePoint3d center(3,3,0);<BR>        AcGeVector3d normal(0,0,1);<BR>        AcDbCircle *pcir=new AcDbCircle(center,normal,1.5);<BR>        AcDbObjectId plineid;<BR>        pbtr-&gt;appendAcDbEntity(plineid,ppline);<BR>        pbtr-&gt;appendAcDbEntity(pline);<BR>        pbtr-&gt;appendAcDbEntity(pcir);<BR>        ppline-&gt;close();<BR>        pline-&gt;close();<BR>        pcir-&gt;close();


        AcGePoint3d pt(8,1.5,0);<BR>        AcDbAttributeDefinition *pattdef=new AcDbAttributeDefinition;<BR>        pattdef-&gt;setPosition(pt);<BR>        pattdef-&gt;setHeight(3);<BR>        pattdef-&gt;setRotation(0);<BR>        pattdef-&gt;setHorizontalMode(AcDb::kTextLeft);<BR>        pattdef-&gt;setVerticalMode(AcDb::kTextBase);<BR>        pattdef-&gt;setPrompt("请输入圆度公差:");<BR>        pattdef-&gt;setTextString("0.3");<BR>        pattdef-&gt;setTag("Tag");<BR>        pattdef-&gt;setInvisible(Adesk::kFalse);<BR>        pattdef-&gt;setVerifiable(Adesk::kFalse);<BR>        pattdef-&gt;setPreset(Adesk::kFalse);<BR>        pattdef-&gt;setConstant(Adesk::kFalse);<BR>        pbtr-&gt;appendAcDbEntity(plineid,pattdef);<BR>        pattdef-&gt;close();<BR>        pbtr-&gt;close();<BR>        pbt-&gt;close();<BR>}

bai_cai101 发表于 2005-3-21 14:30:00

呵呵,我知道是怎么一回事了!!我想问一下,怎么在ARX程序中调用块插入啊?
页: [1]
查看完整版本: 求助,图块问题!