几何尺寸与公差论坛------致力于产品几何量公差标准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-07, 12:06 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】proxy objects. compare odt and dwgdirec

proxy objects. compare odt and dwgdirect
proxy objects. compare odt and dwgdirect
we used odt to import/export projects to dwg/dxf. now we try to switch to dwgdirect.
please help me with backward compatibility proxy_entity. the simple sample:
we need store and read custom object with project preferences.
in odt we:
1. register class (classname, cclassname, appname) and store its number (500, 501 etc.).
2. register application (appname).
3. create new proxy entity with 損roxyent.appclassid?number from first step.
4. fill 損roxyent.entdatablob?and add entity to modelspace.
in dwgdirect we:
1. create and register custom class (classname, cclassname, appname) derived from oddbentity.
2. create new cclassname object and add it to modelspace. filling data implement in dwgoutfields and dxfoutfields.
so:
1. read old dwg file (created by odt) by dwgdirect pass normal.
2. read old dxf file (created by odt) by dwgdirect. first control get function dwgoutfields (why it抯 a load, not save). when control get function dwginfields and load pass normal.
3. read new dwg file (created by dwgdirect) by odt pass normal.
4. read new dxf file (created by dwgdirect) by odt failed. because 揺ntheader.enttype?store 498 (just proxy identifier) not 5xx (class number).
is any way to provide both way compatibility: odt and dwgdirect.
may be my latter is big and difficult for understanding, so i ready to give any additional information an comment.
below i copy parts of dxf files created by odt and dwgdirect (entity section):
odt dxf file:
acad_proxy_entity
5
2e
330
a
100
acdbentity
8
0
100
acdbproxyentity
90
498
91
519
95
917527
70
0
92
8
310
0800000000000000
93
21442
310
...
binary data here
...
94
0
0
dwgdirect dxf file. (class section is a same):
classname
5
35
330
1f
100
acdbentity
8
0
100
cclassname
93
2676
310
...
binary data here
...
0
note. if first save as dwg format, open in autocad 2002 and then save as dxf we get dxf-file looks like odt created.
best regards,
ivan obraztsov

since odt and autocad know nothing about your custom entity they save it as proxy.
dd "knows" your custom class and saves it as yourclass entity.
during file loading if proxy entity is of "known" class it is turned into original object. so autocad and odt load it as proxy and dd with your class registered - as yourclass.
does autocad load your dxf file?
sergey slezkin

autocad normaly load both odt and dwgdirect dxf files.
but after saving dwgdirect dxf file autocad add following codes to acdbentity section:
92
8
310
0800000000000000
best regards,
ivan obraztsov

>>>2. read old dxf file (created by odt) by dwgdirect. first control get function dwgoutfields (why it’s a load, not save). when control get function dwginfields and load pass normal.
it's ok. btw, you can optimize your code to work faster if in your dwgoutfields() function you check filer type and if it's idfiler you can skip writing all data except object ids. corresponding check must present in dwginfields() so that they could work together. surely base class function must be called.
dwgoutfields() and dwginfields() are called not only for file output, but for updating references between objects, cloning, writing undo/redo info etc.
>>>>4. read new dxf file (created by dwgdirect) by odt failed. because “entheader.enttype” store 498 (just proxy identifier) not 5xx (class number).
what is the problem? i think that after odt loads dxf or dwg created by odt entheader.enttype is 498 (proxy entity) too.
the difference maybe the following:
if in odt you always fill proxy binary data in dxf (or dwg) format, you'll get it in the same format after loading.
if file is saved by dwgdirect, after loading it in odt you will get proxy data in dxf or dwg format depending on file type.
to achieve compatibility you need to be able to interpret proxy data in odt in both dxf and dwg formats.
>>>>but after saving dwgdirect dxf file autocad add following codes to acdbentity section:
92
8
310
0800000000000000
it's ok. this data is proxy entity graphic representation. this sequence represents empty graphic data and can be skipped.
[ june 25, 2003: message edited by: sergey slezkin ]</p>
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】moving from odt to dwgdirec yang686526 DirectDWG 0 2009-05-06 06:07 PM


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


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