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

how to build oddbselectionset filter?
how to build oddbselectionset filter?
hello, all!
want to select all closed curves in the drawing and not sure how to build such filter <pseudo code>:
(acdbpolyline && closed) || (acdb2dpolyline && closed) || (acdb3dpolyline && closed) ...
this command gave "oderror thrown: file not found odbagfiler.drx":
code:
oddbselectionsetptr psset = oddbselectionset::select(pdbin,
odresbuf::newrb(odresbuf::kdxflinetypename, odstring:dstring("acdbpolyline")));
where i can read about logic? code snippet will be great.
also, what happened with psset->filteronlyselect()?
i'm with (ddwg220 + msvc60)
life would be so much easier if we could just look at the source codefff">fff">
last edited by gok; 28th march 2007 at 07:37 pmfff">.
1. odbagfiler.drx should be available for complex filtering.
2. logical or is not currently suported in filters, you should do separate filtering, and combine results.
3. dxf class name should be used instead of c++ class name (i.e. "lwpolyline" istead of "acdbpolyline")
4. filteronlyselect() is the same as select(), taking just resbuf chain as a filter.
dxf code 70 in lwpolyline stores 'closed' state, but it also stores 'plinegen' state, so there should be 2 filters: ((0 lwpolyline) (70 1)) and ((0 lwpolyline) (70 129))
(resbufs in lisp notation)
other classes are treated in similar fashion
vladimir
thanks, vladimir, for respond.
1. can not make odbagfiler.drx available:
- did append odbagfiler.cpp/.h to the project. error message still pointing to odbagfiler.drx;
- did move odbagfiler_2.02_6.drx to app .exe folder, got the same error message as in first item.
- was trying to link with exe\debug\odbagfiler_2.02_6.drx: lnk1136: invalid or corrupt file;
how you doing it with toolkit_in_dll option?
2, 3: thanks for hints. will try later.
4. do you know if following approach is correct?
code:
odresbufptr prbuf = odresbuf::newrb(odresbuf::kdxfstart);
odresbufptr xiter = prbuf;
xiter->setstring("lwpolyline");
xiter->setnext(odresbuf::newrb(odresbuf::kdxfint16)); // dxf 70
xiter=xiter->next();
xiter->setint16(oduint16(70));
xiter->setnext(odresbuf::newrb(odresbuf::kdxfint16)); // closed:bit1=1
xiter=xiter->next();
xiter->setint16(1);
xiter->setnext(odresbuf::newrb(odresbuf::kdxfint16)); // dxf 70
xiter=xiter->next();
xiter->setint16(oduint16(70));
xiter->setnext(odresbuf::newrb(odresbuf::kdxfint16)); // linetypegenerationon:bit8=1
xiter=xiter->next();
xiter->setint16(129);
oddbselectionsetptr psset = oddbselectionset::select(
pdbin,
prbuf);
life would be so much easier if we could just look at the source codefff">fff">
that
code:
xiter->setnext(odresbuf::newrb(odresbuf::kdxfint16)); // dxf 70
xiter=xiter->next();
xiter->setint16(oduint16(70));
xiter->setnext(odresbuf::newrb(odresbuf::kdxfint16)); // closed:bit1=1
xiter=xiter->next();
xiter->setint16(1);
should look like
code:
xiter = xiter->setnext(odresbuf::newrb(70)); // dxf 70
xiter->setint16(1);
then, as i said, logical or is not implemented (and if it was implemented, syntax would be another), so you should filter twice - for (70 1), and for (70 129)
anyway, what are you trying to do is much easier to achieve by just traversing modelspace and paperspaces, and asking each entity if it is a curve, and if it is closed.
vladimir

thanks, vladimir, for respond.
can not test your correction, still getting error:
"oderror thrown: file not found odbagfiler.drx"
how i can link this library?
did put dd_vc6md_bagfiler.lib in msvc60 link path, copyed odbagfiler_2.02_6.drx to .exe folder: no luck.
regards,
gok
life would be so much easier if we could just look at the source codefff">fff">
quote:
originally posted by gok
thanks, vladimir, for respond.
can not test your correction, still getting error:
"oderror thrown: file not found odbagfiler.drx"
how i can link this library?
did put dd_vc6md_bagfiler.lib in msvc60 link path, copyed odbagfiler_2.02_6.drx to .exe folder: no luck.
regards,
gok
if you are using static libraries you should link in dd_vc6md_bagfiler.lib, and add appropriate declarations to the static module map:
code:
odrx_declare_static_module_entry_point(odbagfilermoduleimpl);
...
odrx_define_static_appmodule(l"odbagfiler.drx", odbagfilermoduleimpl)
if you are using dll version, adding odbagfiler.drx should be enough
vladimir

vladimir,
i"m building /md version and there is no such file as odbagfiler.drx.
i was trying to rename odbagfiler_2.02_6.drx and placed it
1. with .exe;
2. into system32 folder.
nothing help, still the same message: "file not found odbagfiler.drx".
where i can find this drx library? where i should put it?
regards,
gok
life would be so much easier if we could just look at the source codefff">fff">
i suppose, by /md you mean not only dll runtime but dll dd as well.
you should not rename drx with suffix, place it as is, i just omitted suffix, because all dd modules have version suffix now.
you said you were tryng to put it near exe, and it did not help.
it is really odd, because odbagfiler depends only on dd_db, which is inevitable loaded, if you do anythind with dd database.
perhaps you may create a sample to demonstrate the problem?
vladimir
vladimir,
you are right: it is .exe app with ddxxx.dll linked to it.
please, take a look at my sample project getparamstest.zip (msvc6.0).
in debug folder you'll find test.dxf and debug version for odbagfiler_2.02_6.drx.
hope it will be simple solution as usual.
attached files (35.2 kb, 9 views)

life would be so much easier if we could just look at the source codefff">fff">
you are linking static libraries, not dlls, and at the same time you define _toolkit_in_dll_ - please decide what your intentions are.
if you are going to use static libs - undefine _toolkit_in_dll_.
for bag filer - there is no appropriate declarations in the static module map, that i was describing 3 posts upper.
if you are going to use dlls you have to link with dll import libraries named like dd_*_dll.lib
why didn't you look at example projects?
( for vc6: \projectfiles\win32\msvc6\examples\ )
vladimir

yes, its working now!
1. did remove toolkit_in_dll (expected that this will force dynamic link, my fault);
2. added .._static_module_.. macros for odbagfiler;
3. added .drx to the .exe.
thanks a lot, vladimir!
happy programming!
life would be so much easier if we could just look at the source codefff">fff">
you didn't have to add drx in that case. drx is a dll and just won't be used.
vladimir
yes, thats right. also forgot to metioned: did add odbagfiler.cpp, .h files to the project ().
thanks! great support!
life would be so much easier if we could just look at the source codefff">fff">
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】Gaussian Filter huangyhg 滤波 0 2009-04-13 10:09 AM


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


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