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

explode x-ref
explode x-ref
bonjour,
with acad and a drawing which have x-ref, i can "select all", "explode" and "save as" to have a new .dwg with all objects and without x-ref.
i can also add them in the manager of the x-ref.
how can i include that in odcopyex for example?
thanks
eric p.
last edited by eric pousse; 31st july 2007 at 06:45 amfff">.
so, i have tried that :
code:
oddbblocktableptr ptable = pdb->getblocktableid().safeopenobject();
oddbsymboltableiteratorptr pblkiter = ptable->newiterator();
for (pblkiter->start(); ! pblkiter->done(); pblkiter->step())
{
oddbblocktablerecordptr pblock = pblkiter->getrecordid().safeopenobject();
if (pblock->xrefstatus()!=oddb::kxrfnotanxref)
{
oddbxrefman::setoverlaid(pblock, true);
odresult merr = oddbxrefman::load(pblock);
}
}
but when i save the file, there is no change. the new dwg file is smaller, so xref are not included into it.
thanks
eric p.
hi eric,
try this:
code:
#include "dbblocktable.h"
#include "xrefman.h"
void bindxrefs(oddbdatabase* pdb)
{
odresult res;
res = oddbxrefman::loadall(pdb);
oda_assert(res);
oddbblocktableptr ptbl = pdb->getblocktableid().openobject();
oddbsymboltableiteratorptr it = ptbl->newiterator();
for(; !it->done(); it->step())
{
oddbblocktablerecordptr pblock =
it->getrecordid().openobject(oddb::kforwrite);
if(pblock->isfromexternalreference() && pblock->isresolved())
{
res = oddbxrefman::bind(pblock, true);
oda_assert(res);
}
}
}
best regards!
thank you dmitry that works... but not for all xref.
i have a principal file with 4 xref files and with this procedure only 3 xref objects are included in the principal file ???
eric p.
hi eric,
i have no idea, until i have an example.
so, i post the files.
syrv0fd000a.dwg is the principal file.
thank you.
eric p.
attached files (310.8 kb, 6 views)

hi eric,
i don't see any problem.
all xrefs you sent had loaded.
but one "sl ex pl 01 go 0 fd 100 b.dwg" is missing.
best regards!
perhaps they are all loaded but if i use your procedure "bindxrefs" and after i save the file in dxf, in the new dxf file, only 3 xrefs are included not the 4th which is not the missing xref.
thanks
eric
here is dxf that i saved after binding. it looks exactly as original and contains only unresolved external reference to "sl ex pl 01 go 0 fd 100 b.dwg".
all other (available) xref dwgs became a part of it.
attached files (147.3 kb, 2 views)

yes, it's true so that works for you, but for me, on mac os x, no.
here is the dxf file that i have after binding, with one xref not included.
your dxf file (ascii version) has a size of 1.5 mb.
mine only 1.2.
thank you.
eric
attached files (136.6 kb, 0 views)

so, i have compiled the same program on windows and, like you, i have a dxf file of 1.5 mb, with all objects of all xref files included (except the missing one).
but the size of your file is 1589757 b and mine on windows 1577768.
invisible layers are not the same.
so, there is probably a bug on mac.
i will try on linux.
eric
on linux, i have a dxf file of 1588473 b.
invisible layers are good.
so, there is a little bug on windows and a big on mac...
eric.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】reference designators yang686526 American standards 0 2009-04-29 09:41 PM
【转帖】swx constant x-ref yang686526 SolidWorks二次开发 0 2009-04-13 02:55 PM
【转帖】如何得到硬盘序列号[c#] yogy C# 0 2007-08-01 02:39 PM
从c++到c++/cli yogy vc编程 1 2007-07-23 02:10 PM


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


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