Filtering on XDATA

Filtering on XDATA

Anonymous
Not applicable
439 Views
3 Replies
Message 1 of 4

Filtering on XDATA

Anonymous
Not applicable
I have a program writing XDATA to different types of objects (text and
polylines). The XDATA contains a parcel number and I'd like to be able to
select the "label" (text) and the parcel line (polyline) based on the XDATA.

I tried this filter:

strParcelNumber = "xx-xxx-x-xxxx"
XFilterT(0) = 1001: XFilterD(0) = "MyApp"
XFilterT(1) = 1000: XFilterD(1) = strParcelNumber

and it selected the correct parcel lines, but would not select the text that
has the same XDATA information attached to it.

A second related question is...I have many string "fields" (DXF code 1000)
[what is each item within XDATA called?] in the XDATA. So how do I know
which "field" the filter is checking--or does it just check them all? Not
necessarily an issue here because all the "fields" contain different
information, but it could be relevant down the line.

Thanks for your help.

Ben Rand
CAD Manager
CEntry Constructors and Engineers
brand@centry.net
0 Likes
440 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
It checks all of them and it won't work for simpler (older?) entities: point, line, text, circle, arc, ... maybe others.
0 Likes
Message 3 of 4

Anonymous
Not applicable
I posted a similar question, I think it was in this thread, some time ago.
If you haven't done a search yet, you might want to do so.

I've abandoned (at least for now) the project I was working on that I need
that functionality for. I never seemed to be able to consistently get
filtering to work for anything beyond the appname. One thing I found was
that if the XData was structured with braces, filtering SEEMED to be
possible. Without the braces, nothing at all beyond appname.

I had different appnames for different object types at one. I never
implemented the app, but do use it occasionally. It works, and besides the
fact that "I didn't like it that way", it posed no functional problems.

HTH

"Ben Rand" wrote in message
news:5054335@discussion.autodesk.com...
I have a program writing XDATA to different types of objects (text and
polylines). The XDATA contains a parcel number and I'd like to be able to
select the "label" (text) and the parcel line (polyline) based on the XDATA.

I tried this filter:

strParcelNumber = "xx-xxx-x-xxxx"
XFilterT(0) = 1001: XFilterD(0) = "MyApp"
XFilterT(1) = 1000: XFilterD(1) = strParcelNumber

and it selected the correct parcel lines, but would not select the text that
has the same XDATA information attached to it.

A second related question is...I have many string "fields" (DXF code 1000)
[what is each item within XDATA called?] in the XDATA. So how do I know
which "field" the filter is checking--or does it just check them all? Not
necessarily an issue here because all the "fields" contain different
information, but it could be relevant down the line.

Thanks for your help.

Ben Rand
CAD Manager
CEntry Constructors and Engineers
brand@centry.net
0 Likes
Message 4 of 4

Anonymous
Not applicable
Thanks for the response. My workaround was to setup a function that filtered
for all objects with the XDATA application name I was after, then For Each
through the selection set looking for AcadText objects, then extract the
XDATA and check for the value I was after and exit the For loop when I found
the one I was looking for. Hated to have to do all the extra processing when
it would have been simpler if the filter had just worked (GRRRR!), but at
least it works...

Ben
0 Likes