几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】cannot position a dimension te (http://www.dimcax.com/hust/showthread.php?t=15355)

yang686526 2009-05-04 05:29 PM

【转帖】cannot position a dimension te
 
cannot position a dimension text
cannot position a dimension text
hello everybody,
i created in the attached dbg.dxf a dimension with the following code:
//---------------------------------------------------------------------//
oddbrotateddimensionptr dwgdim = oddbrotateddimension::createobject() ;
dwgdim->setdatabasedefaults(database) ;
dwgdim->setrotation(1.570796326795) ;
dwgdim->setdimlinepoint(odgepoint3d(60.5,53.,0.)) ;
dwgdim->setxline1point(odgepoint3d(148.,108.,0.)) ;
dwgdim->setxline2point(odgepoint3d(70.,53.,0.)) ;
dwgdim->usesettextposition();
dwgdim->settextposition(odgepoint3d(50.7,53.,0.)) ;
//----------------------------------------------------------------//
note that the text position should be (50.7,53.).
now if you open dbg.dxf in autocad, you will see the text positionned at (50.7,50.5) !
why ?
what should i write to really position my dimension text at (50.7,53.) ?
please help!
attached files
hello jerome,
acad recomputes dimension block after loading dxf drawing. you use usesettextposition() but "dimtmove" variable is set to 0 (see description below). so you get changed text position. try to use "dimtmove" equal 2.
note there is bug with recompute dimension block in dwgdirect. we try to fix it in next release.
" sets dimension text movement rules.
0 moves the dimension line with dimension text
1 adds a leader when dimension text is moved
2 allows text to be moved freely without a leader"
best regards,
sergey z.


所有的时间均为北京时间。 现在的时间是 04:09 PM.