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">