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

creating a proxy entity
creating a proxy entity
our application uses it's own entity database (not oddb database).
when we load a dwg, we can read proxy entity data (using oddbentget).
however, we also need to save proxy entities (or "round-trip" them).
dwgdirect seems designed to make proxy entity "read-only".
1. is there any way we can create an oddbproxyentity and set it's application name, class id, xdata etc?
2. if (1) is not possible, is there any way to "round-trip" the proxy entity by moving it from the "input" dwgdirect database to the "output" dwgdirect database?
theoretically it's possible to call oddbproxyentity::createobject() and fill it by oddbentmod(). but round-tripping proxies is no-trivial task. they may have links to other objects. these objects and links (references) must be round-tripped too.
first way is to create objects with exactly the same handles as they had in initial drawing. another way is to translate handles to keep references valid.
one more potential problem is that something which was referenced by proxy entity (linetype, layer, other proxy entity or object) can be erased while living in non-dwgdirect database.
so the risk to corrupt the drawing is rather high.
sergey slezkin
i have not been able to get oddbentmod() to work:
here is the code i am using:
oddbproxyentityptr pproxy = oddbproxyentity::createobject();
//pproxy->setdatabasedefaults(pdb);
//pblock->appendoddbentity(pproxy);
oddbentmod(destproxy, m_xdata);
(m_xdata is the proxy xdata that i have stored from when the dwg was read).
the error i get with the code above is "no database".
if i try pproxy->setdatabasedefaults(pdb), then i get "no classid" message.
what am i doing wrong?
thanks - jh
oddbentmod() should get not xdata but result of oddbentget().
are you sure that you are getting "no class id" from setdatabasedefaults()? not from appendoddbentity()?
sergey slezkin
thanks for your reply.
i am giving oddbentmod() the result of oddbentget() (ie: when i said "proxy xdata" above i mean the results of oddbentget(), let us call it "dxfdata").
setdatabasedefaults() gives an exception when it tries to set the colour (because it tries to get the proxyflags to see if the setcolour() is allowed for this proxy, and the proxyflags() function uses m_pproxyclass, which is not defined at this time.
appendoddbentity() gives "no classid" exception.
oddbentmod() gives "no database" exception (if i leave out setdatabasedefaults() and appendoddbentity()).
problem seems to me to be how to set up the m_pproxyclass in the oddbproxyentity.
is there any example code anywhere that shows how to create a proxy entity and populate it?
- jh
still need some help finding sample code for creating a proxy entitiy, as above.
hi
i still need to be able to create a proxy entity and add it to the database.
please supply code to do this, or provide a link to example code.
thanks
james higgs
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】conversion of proxy objects yang686526 DirectDWG 0 2009-05-04 06:11 PM
【转帖】access to proxy data yang686526 DirectDWG 0 2009-05-04 03:29 PM
【转帖】『theswamp』炸开多段线出错 - 精华帖集合 yang686526 ObjectARX(VB.NET/C#) 0 2009-04-29 05:06 PM
【转帖】objectarx&dummies教程(十三)—— deriving from acdbentity yang686526 ObjectARX(C++) 0 2009-04-16 10:40 AM
【转帖】database-resident entity与not database-resident entity有什么区别? yang686526 ObjectARX(C++) 0 2009-04-16 09:47 AM


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


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