几何尺寸与公差论坛------致力于产品几何量公差标准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-06, 10:18 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】position of text is not correct when reading the attached d

position of text is not correct when reading the attached dx
position of text is not correct when reading the attached dxf-file.
dear all,
the texts are not shown correct when opening the attached dxf-file with odamfcappdll.exe.
they are shown correct when opening it with autocad.
if i only open this dxf-file and don't do any operation whit autocad and save it again. then opening it with odamacappdll.exe again , they are shown correct.
please have a look at the acctached file. thanks!
attached file:
alk.suelfeld.dxf ---- primordial file
alk.suelfeld2.dxf ---- open alk.suelfeld.dxf and don't do any operation with autocad and save it again.
untitled.jpg ---- show in odamfcappdll.exe
untitled2.jpg ---- show in autocad
attached files
hello,
odamfcapp has command ( edit\registred commands \drxdebug\adjusttext ) which call adjustalignment() for all text in database. try to use it. acad do it evry time after load dxf file.
see also dwgdirect help topic "when i load a dxf file and save it as dwg, why does the position of various text strings in the dwg file look incorrect when viewed in autocad? " in faq.
best regards,
sergey z.
last edited by sergey z.; 14th november 2008 at 08:01 amfff">.
quote:
originally posted by sergey z.
hello,
odamfcapp has command ( edit\registred commands \drxdebug\adjusttext ) which call adjustalignment() for all text in database. try to use it. acad do it evry time after load dxf file.
see also dwgdirect help topic "when i load a dxf file and save it as dwg, why does the position of various text strings in the dwg file look incorrect when viewed in autocad? " in faq.
need i call adjustalignment() for all text when i load dwf\dwg file?
and class oddbmtext have not this member function.
i am sorry to tell you that it will throw a exception when i call this function. i don't know why?
last edited by dud@rib.de; 16th november 2008 at 07:11 pmfff">.
quote:
originally posted by dud@rib.de
need i call adjustalignment() for all text when i load dwf\dwg file?
you make a decision for your application.
quote:
originally posted by dud@rib.de
and class oddbmtext have not this member function.
you are right. such function is no sense for oddbmtext.
quote:
originally posted by dud@rib.de
i am sorry to tell you that it will throw a exception when i call this function. i don't know why?
could you explain more detail. sample dwg/dxf file or/and piece of your code will be appreciable.
best regards,
sergey z.
simple flow of our program:
1.read the dxf file which attached above.
2.get blocks from databace
3.get entitys from blcok.
4.if the type of this entity is single text, i will call the function adjustalignment(), then get other attributes of this text, such as text position, text height, and so on. but it will throw a exception when the program run to the function adjustalignment(). by the way, i use the default parameter when i call this function.because i don't know the databace when i call this function in my program.
last edited by dud@rib.de; 17th november 2008 at 05:45 pmfff">.
if you catch oderror you can get it's text description using oderror::description() method.
maybe you open the text entity for read?
sergey slezkin
quote:
originally posted by sslezkin
if you catch oderror you can get it's text description using oderror::description() method.
maybe you open the text entity for read?
the text description of this exception is that "not opened for write".
but i still can't understand.
what's meaning of the comment "this function is called by dwgdirect when a text entity is closed" for the function adjustalignment() in dbtext.h?
i have understood you. the text must be opened for wrtite when i call the function adjustalignment().
so my source code as below:
--------------------------
if (pentity->iskindof(oddbtext::desc()))
oddbtextptr ptext = pentity;
ptext->upgradeopen();
ptext->adjustalignment();
ptext->downgradeopen();
ptext->position();
ptext->height()
......
......
------------------------------
now, the position of the attached file is correct.
do you agree with this solution? i don't know whether it bring other problems after i call this function when i reading the dwg/dwf file or the position of text needn't adjust.
last edited by dud@rib.de; 18th november 2008 at 06:04 pmfff">.
the potential problem is that if required font is missing than position will be recalculated incorrectly because font substituted for missing one has different metrics. this will take place for correct files too (where position is saved to dxf correctly).
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】oddbtext to oddbmte yang686526 DirectDWG 0 2009-05-06 08:17 PM
【转帖】getting correct text size and width factor yang686526 DirectDWG 0 2009-05-05 11:28 AM
【转帖】custom properties for multiple part configurations yang686526 SolidWorks二次开发 0 2009-04-13 10:08 AM
【转帖】linked sketch text now possible1 9sort of0 yang686526 SolidWorks二次开发 0 2009-04-12 09:34 PM
Unicode、UCS、UTF、BMP、BOM huangyhg vc编程 2 2007-01-22 05:43 PM


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


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