尺寸标注问题!!!!!!!!!!!!
<P>在这个高手如云的地方,再次希望有人帮我解决一下下面的这个小问题!</P><P>我做了一个自动标注孔尺寸(包括孔径、孔深)的程序,部分代码如下:</P>
<P> double leaderLength=50;<BR> int iDimColor=1; <BR> int iTextColor=1;<BR> AcCmColor color; <BR> char* dimText=="光孔<>";<BR> 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->setDimlfac(0.125);<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.KongJing/2*cos(PI/4.0),KD.ZB_Y+t+KD.KongJing/2*sin(PI/4.0),0); <BR> AcGePoint3d Pt2(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> AcDbDiametricDimension *pDim = new AcDbDiametricDimension(Pt6,Pt7,leaderLength,dimText,dimrecordid);<BR> pDim->setLeaderLength(20);<BR> AcDbObjectId Id;<BR> pBlockTableRecord->appendAcDbEntity(Id, pDim);<BR> pBlockTableRecord->close();<BR> pDim->close();<BR> }</P>
<P>运行后标出了孔的直径,形式为“光孔Ф120”。其中“Ф120”是系统自动读取生成的。现在我想把Ф换成M,也就是变成“光孔M120”,不知道可不可能,怎末才能实现,请指教,谢谢1</P> 没人理呀 期待中! 顶起来 我也要解决
页:
[1]