![]() |
【转帖】[arx] sos求助:尺寸标注方面问题!!!!!!!
[arx] sos求助:尺寸标注方面问题!!!!!!!
[arx] sos求助:尺寸标注方面问题!!!!!!! 我是一个arx二次开发cad的新手,做了一个尺寸自动标注的程序,部分代码如下: acdbdatabase *pcurdb=acdbhostapplicationservices()->workingdatabase(); acdbdimstyletable *pnewdimtable; pcurdb->getsymboltable(pnewdimtable,acdb::kforwrite); acdbdimstyletablerecord *pnewdimrecord=new acdbdimstyletablerecord(); pnewdimrecord->setdimasz(20);//设置箭头大小 pnewdimrecord->setdimzin(8);//十进制小数显示时,抑制后续零 pnewdimrecord->setdimexe(30);//设置尺寸界线超出尺寸线距离为400 pnewdimrecord->setdimexo(0);//设置尺寸界线的起点偏移量为300 pnewdimrecord->setdimtxt(30);//设置文字高度 pnewdimrecord->setdimtad(1);//设置文字位置-垂直为上方,水平默认为居中,不用设置 pnewdimrecord->setdimgap(10);//设置文字位置-从尺寸线的偏移量 pnewdimrecord->setdimtih(0); pnewdimrecord->setdimtix(1);//设置标注文字始终绘制在尺寸界线之间 pnewdimrecord->setdimtofl(1);//即使箭头放置于测量点之外,尺寸线也将绘制在测量点之间 // pnewdimrecord->setdimgap(0.5); color.setcolorindex(idimcolor); pnewdimrecord->setdimclrd(color); //尺寸线颜色 pnewdimrecord->setdimclre(color); //尺寸边界线颜色 color.setcolorindex(itextcolor); pnewdimrecord->setdimclrt(color); //文字颜色 acdbobjectid dimrecordid; pnewdimtable->add(dimrecordid,pnewdimrecord); pnewdimtable->close(); pnewdimrecord->close(); acgepoint3d pt1(kd[k].zb_x+t,kd[k].zb_y+t,0); acgepoint3d pt2(dy.m_chang+t,kd[k].zb_y+t,0); acgepoint3d pt3(kd[k].zb_x+t,dy.m_kuan+t+150+k*70,0); acgepoint3d pt6(kd[k].zb_x+t-kd[k].kongjing/2*cos(pi/4.0),kd[k].zb_y+t+kd[k].kongjing/2*sin(pi/4.0),0); acgepoint3d pt7(kd[k].zb_x+t+kd[k].kongjing/2*cos(pi/4.0),kd[k].zb_y+t-kd[k].kongjing/2*sin(pi/4.0),0); acdbblocktable *pblocktable;//定义块表指针 acdbhostapplicationservices()->workingdatabase() ->getsymboltable(pblocktable, acdb::kforread); acdbblocktablerecord *pblocktablerecord; pblocktable->getat(acdb_model_space, pblocktablerecord, acdb::kforwrite); pblocktable->close(); acdbaligneddimension *pdim1 = new acdbaligneddimension(pt1, pt2,pt3,null,dimrecordid); acdbdiametricdimension *pdim3 = new acdbdiametricdimension(pt6, pt7,leaderlength,dimtext,dimrecordid); pdim3->setleaderlength(20); acdbobjectid id; pblocktablerecord->appendacdbentity(id, pdim1); pblocktablerecord->appendacdbentity(id, pdim3); pblocktablerecord->close(); pdim1->close(); pdim3->close(); 现在我希望标出的值是图形实际尺寸的一半,而不是尺寸的实际值,不知道对程序怎样操作。恳请高手不吝赐教,再次表示感谢,鲜花赠上 acdbrotateddimension *pdim;pdim->setdimlfac(0.5)就可以了 谢谢wuddy的热心指教,问题解决了。 再次表示感谢!! |
| 所有的时间均为北京时间。 现在的时间是 01:40 AM. |