查看单个帖子
旧 2009-05-04, 05:29 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)