查看单个帖子
旧 2009-05-04, 06:55 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】custom data - proxy

custom data - proxy?
custom data - proxy?
hello,
i am experiencing some strange problems:
i created a new class and defined:
odrx_dxf_define_members(exoddbcircle,
oddbcircle,
dbobject_constr,
oddb::kdhl_current,
oddb::kmreleasecurrent,
0,
circle,
autocad);
than i filled the circle data into new instance of this class and added into the database.
when i created dxf file, i got group code 310 with some "binary" data.
when i created dwg file, autocad reports, that there are some proxy objects.
my question is:
is it possible to write such class just like an ordinary oddbcircle, without proxy data and 310 group code? i use this derived class, only to keep some custom data with the entity, through the application, but when i store it, into dxf i want to store just ordinary circle. is this possible?
please, can anyone help me with this issue?
best regards, tomaz.
hello,
you implemented custom entity and autocad reads it in as proxy because it has no arx application available implementing your entity (exoddbcircle).
it does not complain on missing arx while loading dxf because you specified the same dxf name as circle have.
for dwgdirect exoddbcircle is custom entity too so it saves its graphic representation under 310 group code.
the method we discussed in
works for creating new entities and entities loaded from dxf but not from dwg.
i'll try to implement the functionality you need (it seems to be interesing and usefull feature for next release) and send it to you for testing. if you are interested in it, i have a couple of question: do you have sources and what is your platform?
sergey slezkin

hello, sergey
i will be very happy, if this functionality will be implemented in the next release, and of course i am already looking forward to test this functionality before the release. in previous post you asked me, if i have the sources. i suppose, that you meant the sources for my application. yes, i have them and i can build the application with dwgdirect libraries.
i use windows and hpux platforms. since windows is more close (user friendly) to me, i work mostly on windows xp and i use dd_vc2003 libraries for visual studio 7.1
i have one additional question.
when approximately will be available the next release?
this is important to me just to know if i can wait for this fix, or i should implement it in other way.
thanks a lot for your help
best regards, tomaz
asking about sources i meant dd sources (to determine in what form i can pass you new functionality - source code or libraries). as i understood you are not a founding member and have no dd source.
next release is not scheduled yet. (maybe 1-2 months, i don't know exactly) but i think i can build 2003 libraries for you or make an additional object module. as for hp ones - i have no ability to build them but i'll try to find a decision.
sergey slezkin

hi sergey,
you are right, i do not have the dd sources, i am a sustaining member.
it would be great if you could create at least 2003 libraries for testing.
when the release will be available, i assume, that this solution will be implemented in all libraries.
best regards, tomaz

hello sergey,
since i heard, that dd 1.11 is scheduled for mid to late april, i am wandering what is the status of this problem? will this be implemented for the next release?
best regards, tomaz
i hope the problem will be solved in 1.11. but as i heard next release is tentatively scheduled for mid to late may.
sergey slezkin

hello sergey,
can you please help me out with this problem here?
i have upgraded the library to 1.11, but just can't find a solution of the problem.
i still ger proxy data written in dxf file. is there something additional to be done, when creating such entities?
my class structure is still the same as in first post of this thread
(is it correct?):
odrx_dxf_define_members(exoddbcircle,
oddbcircle,
dbobject_constr,
oddb::kdhl_current,
oddb::kmreleasecurrent,
0,
circle,
autocad);
best regards, tomaz
the proxy graphic data is still written to dxf (and dwg) since you use standard method of creating custom entity. such entities are saved to file as your entity not as the base one. the trick with the same dxf name as base class dxf name can't help. it only leads to writing invalid dxf files.
in 1.11 we introduced another method - exactly what you requested. ability to substitute run-time class and to store your data in it. and such objects are saved to file as their parent "standard" class.
the example code is in odamfcapp sample. look at the beginning of debugcommand.h - the first block of code under #if 0.
excustwipeout is substituted for oddbwipeout.
circle classes illustrate the situation than you have excustcircle derived from excustbasecircle.
if your classes store a data you need to implement dwginfields() and dwgoutfields() which read/write the data in case of non-file filer. this is required to make cloning, undo/redo etc. working correctly with your objects.
sergey slezkin

sergey,
thanks a lot. this is the functionality, which i needed.
i have implemented class exoddbcircle (similar as excustwipeout in your example). dxf and dwg files, were correctly created (without proxy data).
i have one additional question regarding this issue:
the same class exoddbcircle i use also at loading dxf/dwg files. i have this code, to tell loader which classes to use instead original ones:
odrxclassdictionary()->putat("acdbcircle", exoddbcircle::desc());
then when i traverse through entities i use:
if(pent->iskindof(oddbcircle::desc())
{
// do something
}
when i load a dwg file with a circle, the above code is executed (oddbcircle entity is found), but when i load a dxf file with a circle, the above code is not executed (circle is not found).
since oddbcircle class is parent of exoddbcircle, it is logical, that
iskindof(oddbcircle::desc()) should find also exoddbcircle class.
if i have following definition of custom object, in both cases (dxf and dwg) loader correctly recognized and finds oddbcircle entity in the file.
odrx_dxf_define_members(exoddbcircle,
oddbcircle,
dbobject_constr,
oddb::kdhl_current,
oddb::kmreleasecurrent,
0,
circle,
autocad);
is there a reason why this does not work, if i have following definition of class, or is it a bug?
oddb_pseudo_define_members(exoddbcircle,
oddbcircle,
oddbcircle,
dbobject_constr
best regards, tomaz
you need not call
odrxclassdictionary()->putat("acdbcircle", exoddbcircle::desc());
you need to call exoddbcircle::rxinit() -
see debugcommand.h from odamfcapp sample.
sergey slezkin

sergey,
thanks for the tip.
i had both lines in my code:
exoddbcircle::rxinit();
odrxclassdictionary()->putat("acdbcircle", exoddbcircle::desc());
now i removed (odrxclassdictionary()->putat...) and it works great.
this is a really nice feature of dwgdirect library.
thank you for help.
best regards, tomaz

hello sergey,
i have one more question regarding this approach and proxy entities.
when i create r14 dxf/dwg file and load it into autocad r14, i get a message dialog, that some proxy entities are in the file. but i did not create any proxy entities. when i open the same drawing in autocad 2004, all is ok (no message is displayed). is there any way, when creating r14 files, that autocad r14 will not show this dialog when loading the file? (i think that this was possible in old od toolkit libs).
i have attached the dialog picture.
best regards, tomaz
attached images (7.2 kb, 8 views)

if you create a new empty drawing in autocad 2000 and save it to r14, ac14 will show the same dialog. this is because some r15 objects (layouts for example) are treated by ac14 as proxies. they are saved by ac15 to r14 for round-tripping.
in dd saving round trip info is optional but even if round trip info is not saved r15 classes present in classes section causing message dialog in r14.
this is to be fixed in dd.
sergey slezkin

hi sergey,
autocad r14 really shows this dialog with files created by autocad2000.
it is also quite bothering, that when i create file for autocad 2000 in dd, and load it into autocad 2000, i get the same dialog, but if i create the file with autocad 2004, this dialog does not appear.
can you please write a command, which disables saving round trip?
is it possible to fix this for the next maintenance release, which i heard is planned to be available soon?
best regards, tomaz
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)