Extended Entity Data Filter

Extended Entity Data Filter

Anonymous
Not applicable
619 Views
11 Replies
Message 1 of 12

Extended Entity Data Filter

Anonymous
Not applicable
Is it possible to filter for specific extended entity data beyond just the application name? (I've tried several times before and haven't had any success beyond the app name, so thought I'd post the question here before I try again.)
0 Likes
620 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable
Scratch that last question, I think I just figured out why it didn't work for me, before. Sample of successful filter variants, for anyone who may be wondering.... vCod(0) = 1001: vVal(0) = kAppName vCod(1) = 1002: vVal(1) = "{" vCod(2) = 1040: vVal(2) = 54# vCod(3) = 1002: vVal(3) = "}" ....in previous attempts, I had neglected to put in the 1002/brackets "TomD" wrote in message news:4224ced2$1_3@newsprd01... > Is it possible to filter for specific extended entity data beyond just the > application name? > > (I've tried several times before and haven't had any success beyond the > app name, so thought I'd post the question here before I try again.) >
0 Likes
Message 3 of 12

Anonymous
Not applicable
You should be aware that it won't work for simpler (older?) entities: point, line, text, circle, arc, ... maybe others.
0 Likes
Message 4 of 12

Anonymous
Not applicable
Could you explain a little further, please? I've run some successful, albeit early, testing on some lightweight polylines this way, seemingly working fine. Any hard-learned lessons appreciated. ;) "fantum" wrote in message news:27634982.1109711055606.JavaMail.jive@jiveforum1.autodesk.com... > You should be aware that it won't work for simpler (older?) entities: > point, line, text, circle, arc, ... maybe others.
0 Likes
Message 5 of 12

Anonymous
Not applicable
TomD wrote: > Could you explain a little further, please? > > I've run some successful, albeit early, testing on some lightweight > polylines this way, seemingly working fine. > > Any hard-learned lessons appreciated. ;) What version of Autocad are you using ? I would have told you that you could never filter based on anything other than Application Name, but apparently that is not true. I am surprised ! Have you successfully filtered on all datatypes ? (strings, ...)
0 Likes
Message 6 of 12

Anonymous
Not applicable
Documentation and received wisdom notwithstanding, it is possible to filter a selection based on extended entity data beyond the appname in versions 2000 through at least 2005 for some entity types. These types include lightweight polyline, mtext, ellipse, etc. but do not include line, text, circle, etc.
0 Likes
Message 7 of 12

Anonymous
Not applicable
"Arnaud Lesauvage" wrote in message news:4225719b$1_2@newsprd01... > TomD wrote: >> Could you explain a little further, please? >> >> I've run some successful, albeit early, testing on some lightweight >> polylines this way, seemingly working fine. >> >> Any hard-learned lessons appreciated. ;) > > What version of Autocad are you using ? > I would have told you that you could never filter based on anything other > than Application Name, but apparently that is not true. > > I am surprised ! Have you successfully filtered on all datatypes ? > (strings, ...) I've only tested with 2005, but could try 2004 if it would be helpful for you. The only successful filtering was by a 1010 3d point, so far. I plan to do some other testing, relatively soon, though, on something different that I already have XData in use with. I should clarify that I'm not doing anything too high end with it, so there could certainly be caveats. (I'm a "cad guy/designer" first, programming is an advanced hobby, I guess you could say.) Some of the code follow. It's simple enough that anyone following this thread could likely figure it out, fairly quickly, so I'm skipping that. (Also, if you're thinking that I shouldn't be finding a drainage area by a point stored in XData, I'd normally agree with you....lol......don't ask.....just testing an idea.) Function TagDrainageArea(oEnt As AcadEntity, vXyz As Variant, dCw As Double) As Boolean Dim vCod(5) As Integer, vVal(5) As Variant Dim dPnt(2) As Double dPnt(0) = vXyz(0): dPnt(1) = vXyz(1): dPnt(2) = vXyz(2) vCod(0) = 1001: vVal(0) = kAppName vCod(1) = 1002: vVal(1) = "{" vCod(2) = 1000: vVal(2) = "DrainageArea" vCod(3) = 1011: vVal(3) = dPnt 'World Space Position...moves with entity! vCod(4) = 1040: vVal(4) = dCw 'Weighted C vCod(5) = 1002: vVal(5) = "}" oEnt.SetXData vCod, vVal End Function When I ran the initial tests with the following function, I did get the appropriate entities returned.....at least it appears that I did. Again, the testing has not been thorough, by any means. Function GetAreasForPosition(vXyz As Variant) As AcadSelectionSet Dim vCod(4) As Integer, vVal(4) As Variant Dim dFocusPoint(2) As Double Dim oSet As AcadSelectionSet dFocusPoint(0) = vXyz(0): dFocusPoint(1) = vXyz(1): dFocusPoint(2) = vXyz(2) vCod(0) = 1001: vVal(0) = kAppName vCod(1) = 1002: vVal(1) = "{" vCod(2) = 1000: vVal(2) = "DrainageArea" vCod(3) = 1011: vVal(3) = dFocusPoint vCod(4) = 1002: vVal(4) = "}" Set oSet = SelSetInit("CEC-SD-STORM-ObjectCollector") oSet.Select acSelectionSetAll, , , vCod, vVal Set GetAreasForPosition = oSet End Function
0 Likes
Message 8 of 12

Anonymous
Not applicable
I certainly don't dispute what you're saying, I'm just basically confused as to why that would be. It wouldn't seem to matter (based solely on my experience or lack thereof). Where did you find documentation on this topic? The documentation I've found, to this point, regarding XData in VBA, is very limited, at best. Thanks for the info, in any case. "fantum" wrote in message news:15457196.1109767070041.JavaMail.jive@jiveforum1.autodesk.com... > Documentation and received wisdom notwithstanding, it is possible to > filter a selection based on extended entity data beyond the appname in > versions 2000 through at least 2005 for some entity types. These types > include lightweight polyline, mtext, ellipse, etc. but do not include > line, text, circle, etc.
0 Likes
Message 9 of 12

Anonymous
Not applicable
TomD wrote: > Function TagDrainageArea(oEnt As AcadEntity, vXyz As Variant, dCw As Double) > As Boolean > Dim vCod(5) As Integer, vVal(5) As Variant > Dim dPnt(2) As Double > dPnt(0) = vXyz(0): dPnt(1) = vXyz(1): dPnt(2) = vXyz(2) > vCod(0) = 1001: vVal(0) = kAppName > vCod(1) = 1002: vVal(1) = "{" > vCod(2) = 1000: vVal(2) = "DrainageArea" > vCod(3) = 1011: vVal(3) = dPnt 'World Space Position...moves with > entity! > vCod(4) = 1040: vVal(4) = dCw 'Weighted C > vCod(5) = 1002: vVal(5) = "}" > oEnt.SetXData vCod, vVal > End Function > > When I ran the initial tests with the following function, I did get the > appropriate entities returned.....at least it appears that I did. Again, > the testing has not been thorough, by any means. > > Function GetAreasForPosition(vXyz As Variant) As AcadSelectionSet > Dim vCod(4) As Integer, vVal(4) As Variant > Dim dFocusPoint(2) As Double > Dim oSet As AcadSelectionSet > dFocusPoint(0) = vXyz(0): dFocusPoint(1) = vXyz(1): dFocusPoint(2) = > vXyz(2) > vCod(0) = 1001: vVal(0) = kAppName > vCod(1) = 1002: vVal(1) = "{" > vCod(2) = 1000: vVal(2) = "DrainageArea" > vCod(3) = 1011: vVal(3) = dFocusPoint > vCod(4) = 1002: vVal(4) = "}" > Set oSet = SelSetInit("CEC-SD-STORM-ObjectCollector") > oSet.Select acSelectionSetAll, , , vCod, vVal > Set GetAreasForPosition = oSet > End Function Very nice ! That opens new ways of selecting data ! I'll give it a try ! Arnaud
0 Likes
Message 10 of 12

Anonymous
Not applicable
> I'm just basically confused as to why that would be.

Since it seems that it doesn't work on the more primitive types I would guess that it was a design decision made a little late at autodesk and not back-ported.

> Where did you find documentation on this topic? The documentation I've
> found, to this point, regarding XData in VBA, is very limited, at best.

It is a bit thin on the ground. It's been a while but for filtering I probably worked mostly with the lisp docs.
0 Likes
Message 11 of 12

Anonymous
Not applicable
"fantum" wrote in message news:25421928.1109854858357.JavaMail.jive@jiveforum1.autodesk.com... >> I'm just basically confused as to why that would be. > > Since it seems that it doesn't work on the more primitive types I would > guess that it was a design decision made a little late at autodesk and not > back-ported. > >> Where did you find documentation on this topic? The documentation I've >> found, to this point, regarding XData in VBA, is very limited, at best. > > It is a bit thin on the ground. It's been a while but for filtering I > probably worked mostly with the lisp docs. Thanks for the info. If I happen across anything of interest about XData on this project, I'll be sure to post.
0 Likes
Message 12 of 12

Anonymous
Not applicable
"Arnaud Lesauvage" wrote in message news:4226c8aa$1_3@newsprd01... > Very nice ! That opens new ways of selecting data ! > I'll give it a try ! I'm finding the previous logic to be unreliable, at best............thought I'd warn you. Peter, we wish you were here! 😉
0 Likes