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


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-05, 11:28 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】getting correct text size and width factor

getting correct text size and width factor?
getting correct text size and width factor?
hi,
i am using dwgdirect version 1.14 with vc2005. i am having the following problem.
if i use the following code as is written in the odvectorizeex example then the size of the font and the width factor are not correct and are always 1.0000 and 1.0000 respectively. the code is
odgitextstyle& textstyle;
textstyle.textsize();
textstyle.xscale();
and on the other hand, if i use the following code as is written in the odreadex example then the size and the width factor of the font are returned correctly. the code is
oddbtext* ptext;
ptext->height();
ptext->widthfactor();
can any body please tell me that how i can get the correct font size and the width factor by using the first method because i am using vectorization in my application.
please help me!
best regards,
faisal.
quote:
originally posted by f_shaukat
hi,
i am using dwgdirect version 1.14 with vc2005. i am having the following problem.
if i use the following code as is written in the odvectorizeex example then the size of the font and the width factor are not correct and are always 1.0000 and 1.0000 respectively. the code is
odgitextstyle& textstyle;
textstyle.textsize();
textstyle.xscale();
and on the other hand, if i use the following code as is written in the odreadex example then the size and the width factor of the font are returned correctly. the code is
oddbtext* ptext;
ptext->height();
ptext->widthfactor();
can any body please tell me that how i can get the correct font size and the width factor by using the first method because i am using vectorization in my application.
please help me!
best regards,
faisal.
hi faisal,
method odgiconveyorgeometrydumper::textproc() has parameters const odgevector3d& direction and const odgevector3d& upvector. text size and width factor may be calculate by next way:
textsize() = upvector.length()
widthfactor() = direction.length()/upvector.length()
best regards,
sergey z.
getting correct text size and width factor
hi sergey z.
thank you very much for your reply. first, in the odgiconveyorgeometrydumper::textproc() there are no direction and up vector but only u and v vectors. i used both u and v vectors interchangeable for the direction and up vectors but the result was some times wrong. i have attached an exmaple dwg file on which the above method gives wrong result for at least one text entry.
secondly, i have one more question regarding the same attached file. there is an acdbmtext entry in this file. if this file is vectorized then the odgiconveyorgeometrydumper::textproc() method gets control for all of the acdbtext entries but it does not gets control for the acdbmtext entry and the control goes to the odgiconveyorgeometrydumper::shellproc() directly. why so?
i do not need the reduced data of the acdbmtext entry. what can i do in this case?
please help!
thanks in advance,
faisal.
attached files (27.9 kb, 5 views)

quote:
originally posted by f_shaukat
first, in the odgiconveyorgeometrydumper::textproc() there are no direction and up vector but only u and v vectors. i used both u and v vectors interchangeable for the direction and up vectors but the result was some times wrong. i have attached an exmaple dwg file on which the above method gives wrong result for at least one text entry.
faisal.
u is direction and v is up vector. you need comment line seteyetooutputtransform(eye2screen) in method exsimpleview::update()(file exgssimpledevice.cpp). in this case you get height and width factor in drawing measurement.
quote:
originally posted by f_shaukat
hi sergey z.
secondly, i have one more question regarding the same attached file. there is an acdbmtext entry in this file. if this file is vectorized then the odgiconveyorgeometrydumper::textproc() method gets control for all of the acdbtext entries but it does not gets control for the acdbmtext entry and the control goes to the odgiconveyorgeometrydumper::shellproc() directly. why so?
i do not need the reduced data of the acdbmtext entry. what can i do in this case?
acdbmtext is complex entity and it is rendered by fragments. so you will get a pieces of mtext in vectorizer. your file contains the simple mtext but it is special case. in case mtext has two line you will get two calls method textproc().
in case you don't need getting shells you may change inisialize odgiconveyorgeometrydumper (use in constractor m_dumplevel(minimal_simplification) ).
best regards,
sergey z.
getting correct text size and width factor
hi sergey z.,
thank you very much for your reply.
i want to restate the second question again. the problem is that i have already set the m_dumplevel to minimal_simplification, but still the control goes to the shell. this seems more of a bug because some times the flow of control is like
acdbmtext
textproc()
shellproc() // when used with maximal simplification
shellproc() // when used with maximal simplification
textproc()
shellproc() // when used with maximal simplification
shellproc() // when used with maximal simplification
end acdbmtext
and some times, even with the minimal simplification, the control is like
acdbmtext
shellproc()
shellproc()
shellproc()
shellproc()
end acdbmtext
note that there are even no textprocs but still the control goes to shell proc.
i am facing this problem in general. for example, i have another file and i did the vectorization on this file twice. first, in the original file. the vectorization does not have any calls to shells. and then i introduced a little change, like i added a layout and now the outcome of vectorization contains shell entities as well. why so?
please reply on this issue because i am having trouble because of this.
thanks again,
faisal.
hi faisal,
it's not a bug. it happens because text's geometry is clipped by a viewport boundary, so it can't be represented by a textproc() primitive after that. you can disable viewport clipping (by commenting out pushclipboundary() and popclipboundary() calls in exsimpleview::update()). note that drawing may contain model clipping on block insertions also.
last edited by dmitry a. novikov; 29th november 2006 at 04:28 amfff">.
getting correct text size and width factor
dear novikov,
thank you very much. my problem is solved by your reply!
best regards,
faisal.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】asme - where to star yang686526 American standards 0 2009-04-29 07:28 PM
【转帖】哪位高手指点一下下边lisp的怎么用 yang686526 数据库ObjectDBX 0 2009-04-28 12:13 PM
哪位高手指点一下下边lisp的怎么用 yang686526 ObjectARX(AutoLISP) 0 2009-04-26 06:19 PM
【转帖】resize te yang686526 SolidWorks二次开发 0 2009-04-12 10:14 PM


所有的时间均为北京时间。 现在的时间是 05:39 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多