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

inherited entities
inherited entities
hello,
i have a problem at loading inherited entities:
when i define new class
----------------------------------------------------------------------------------------
class exoddbline : public oddbline
{
public:
oddb_declare_members(exoddbline);
}
odrx_dxf_define_members(exoddbline, oddbline, dbobject_constr, oddb::kdhl_current, oddb::kmreleasecurrent, 0, line, autocad);
exoddbline::rxinit();
odrxclassdictionary->putat("acdbline", exoddbline::desc());
----------------------------------------------------------------------------------------
opendwg library reads a line entity from dxf file directly into my new exoddbline class.
but, when i try similar with (ordinate) dimension:
----------------------------------------------------------------------------------------
class exoddbordinatedimension : public oddbordinatedimension
{
oddb_declare_members(exoddbordinatedimension);
}
odrx_dxf_define_members(exoddbordinatedimension, oddbordinatedimension, dbobject_constr, oddb::kdhl_current, oddb::kmreleasecurrent, 0, dimension, autocad);
exoddbordinatedimension::rxinit();
odrxclassdictionary->putat("acdbordinatedimension", exoddbordinatedimension::desc());
----------------------------------------------------------------------------------------
opendwg libary does not fill the data from ordinate dimension into my new class, but it fills it into oddbordinatedimension class.
what do i have to do, if i want that opendwg library fills the data directly into my new derived class of ordinate and other dimensions.
will this feature be available also at loading dwg files?
regards, tomaz
this method does not work while loading dwg files. it also does not work while loading dxf (for entities like polyline, vertex, dimension, insert).
what's the purpose of substituting run-time classes? maybe protocol extensions will work for you?
sergey slezkin

hi,
protocol extension do not work for me.
i need aditional data in some entities, so the best way to store it is in the entity class. if library do not create such class by default, i have to replace original class with my new one. (performance issue)
it would be nice, if it would work for dwg as it works for dxf.
regards, tomaz
standard way of storing additional data in entities is extended data (xdata) or xdictionary.
sergey slezkin
hello,
yes, i know that storing additional data should go into xdata, but this data is only needed while the application is running, and it is not stored into file.
1. entities are loaded.
2. entities are 'corrected' - also some additional data is stored in them
3. entities are converted to other format and written into file.
this is a converter from dxf/dwg into other file formats.
so, this functionality, that dwgdirect library creates inherited classes is not obligatory for the application, but it is the best way, to keep additional data, which is connected with each entity.
regards, tomaz
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】how to get the color of merged entities yang686526 DirectDWG 0 2009-05-06 02:44 PM
【转帖】hatching entities yang686526 DirectDWG 0 2009-05-05 12:01 PM
【转帖】exploding block references = invisible entities yang686526 DirectDWG 0 2009-05-05 10:17 AM
【转帖】coping entities yang686526 DirectDWG 0 2009-05-04 06:18 PM
【转帖】block entities are not erased after the block deleting yang686526 DirectDWG 0 2009-05-04 04:46 PM


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


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