[ARX] SOS求助:尺寸标注方面问题!!!!!!!
<P>我是一个ARX二次开发CAD的新手,做了一个尺寸自动标注的程序,部分代码如下:</P><P>AcDbDatabase *pcurdb=acdbHostApplicationServices()->workingDatabase();<BR> AcDbDimStyleTable *pnewdimtable;<BR> pcurdb->getSymbolTable(pnewdimtable,AcDb::kForWrite);<BR> AcDbDimStyleTableRecord *pnewdimrecord=new AcDbDimStyleTableRecord();<BR> pnewdimrecord->setDimasz(20);//设置箭头大小<BR> pnewdimrecord->setDimzin(8);//十进制小数显示时,抑制后续零<BR> pnewdimrecord->setDimexe(30);//设置尺寸界线超出尺寸线距离为400<BR> pnewdimrecord->setDimexo(0);//设置尺寸界线的起点偏移量为300<BR> pnewdimrecord->setDimtxt(30);//设置文字高度<BR> pnewdimrecord->setDimtad(1);//设置文字位置-垂直为上方,水平默认为居中,不用设置<BR> pnewdimrecord->setDimgap(10);//设置文字位置-从尺寸线的偏移量<BR> pnewdimrecord->setDimtih(0); <BR> pnewdimrecord->setDimtix(1);//设置标注文字始终绘制在尺寸界线之间<BR> pnewdimrecord->setDimtofl(1);//即使箭头放置于测量点之外,尺寸线也将绘制在测量点之间<BR> // pnewdimrecord->setDimgap(0.5);<BR> color.setColorIndex(iDimColor); <BR> pnewdimrecord->setDimclrd(color); //尺寸线颜色 <BR> pnewdimrecord->setDimclre(color); //尺寸边界线颜色 <BR> color.setColorIndex(iTextColor); <BR> pnewdimrecord->setDimclrt(color); //文字颜色 </P>
<P> AcDbObjectId dimrecordid;<BR> pnewdimtable->add(dimrecordid,pnewdimrecord);<BR> pnewdimtable->close();<BR> pnewdimrecord->close();<BR> <BR> AcGePoint3d Pt1(KD.ZB_X+t,KD.ZB_Y+t,0); <BR> AcGePoint3d Pt2(DY.m_Chang+t,KD.ZB_Y+t,0);<BR> AcGePoint3d Pt3(KD.ZB_X+t,DY.m_Kuan+t+150+k*70,0);<BR> AcGePoint3d Pt6(KD.ZB_X+t-KD.KongJing/2*cos(PI/4.0),KD.ZB_Y+t+KD.KongJing/2*sin(PI/4.0),0); <BR> AcGePoint3d Pt7(KD.ZB_X+t+KD.KongJing/2*cos(PI/4.0),KD.ZB_Y+t-KD.KongJing/2*sin(PI/4.0),0); <BR> <BR> AcDbBlockTable *pBlockTable;//定义块表指针<BR> acdbHostApplicationServices()->workingDatabase()<BR> ->getSymbolTable(pBlockTable, AcDb::kForRead);<BR> AcDbBlockTableRecord *pBlockTableRecord;<BR> pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,<BR> AcDb::kForWrite);<BR> pBlockTable->close();<BR> AcDbAlignedDimension *pDim1 = new AcDbAlignedDimension(Pt1, Pt2,Pt3,NULL,dimrecordid);<BR> AcDbDiametricDimension *pDim3 = new AcDbDiametricDimension(Pt6, Pt7,leaderLength,dimText,dimrecordid);<BR> pDim3->setLeaderLength(20);<BR> AcDbObjectId Id;<BR> pBlockTableRecord->appendAcDbEntity(Id, pDim1);<BR> pBlockTableRecord->appendAcDbEntity(Id, pDim3);<BR> pBlockTableRecord->close();<BR> pDim1->close();<BR> pDim3->close();</P>
<P>现在我希望标出的值是图形实际尺寸的一半,而不是尺寸的实际值,不知道对程序怎样操作。恳请高手不吝赐教,再次表示感谢,鲜花赠上</P> <P>AcDbRotatedDimension *pdim;pdim->setDimlfac(0.5)就可以了</P> <P>谢谢<A name=55648><FONT color=#000066><B>wuddy</B></FONT></A>的热心指教,问题解决了。</P>
<P>再次表示感谢!!</P> 为什么在我的电脑上运行有问题
页:
[1]