Search the Community
Showing results for tags 'ssget filter'.
Found 4 results
Hey all, i'm trying to "catch" a line with ssget. I know the x-coordinate of either the start- or the endpoint of the line i'm looking for, but i can't be sure wether it's gonna be the start- or endpoint having that certain x-coordinate. Also i want to include a certain "fuzz" factor, because the drawing is not super-accurate, with some of the entities not residing exactly where they should, but being "off" by about 0.00001 units or some such. So originally i went with the crossing option of ssget (i.e. (ssget "_C" 'pt1 'pt2)), but that didn't quite work right because the crossing option is dependant on objects being visible in the drawing area at the time of calling ssget and i want to iteratively catch lines scattered all over my drawing. So then i thought I'll just use (ssget "X") and filter for my lines, so this a minimal working example of what i've come up with: (defun c:get_line_by_start_or_endpoint ( x tol /) (ssget "X" (list '(-4 . "<OR") '(-4 . "<AND") '(-4 . "<=,*,*") (list 10 (+ x tol) 0.0 0.0) '(-4 . ">=,*,*") (list 10 (- x tol) 0.0 0.0) '(-4 . ">AND") '(-4 . "<AND") '(-4 . "<=,*,*") (list 11 (+ x tol) 0.0 0.0) '(-4 . ">=,*,*") (list 11 (- x tol) 0.0 0.0) '(-4 . ">AND") '(-4 . ">OR") '(0 . "LINE") '(8 . "MyLayer"))) ) Because i don't know wether it's gonna be the start- or the endpoint having the x-coordinate i'm looking, i have to use the whole "<or <and >and <and >and >or"-construct. Well the thing is it didn't work and as far as i can tell the problem seems to be, that the combination of "<and ... >and" with the relational ">=,*,*" / "<=,*,*" operatos. I tried catching lines only by the starting point omitting the whole <or <and and> <and and> or> construct and only using <=,*,* >=,*,* and it's working just fine: (defun c:get_line_by_startpoint ( x tol /) (ssget "X" (list '(-4 . "<=,*,*") (list 10 (+ x tol) 0.0 0.0) '(-4 . ">=,*,*") (list 10 (- x tol) 0.0 0.0) '(0 . "LINE") '(8 . "MyLayer"))) ) The problem is i honestly can't tell beforehand wether it's gonna be the start- or the endpoint having the specific x-coordinate. And of course i could just ssget for startpoints and ssget for endpoints and then combine the two selectionsets, but at this point this has become somewhat a matter of principle for me, because there just has to be a way to combine the operators that i need and make it work. So has anybody experience with combining logical and relational operators in a ssget function and might be able to point me in the right direction? Is there something i am missing? Any help would be greatly appreciated!
Hello Everybody, this is my first post and I'd like to know a little bit more about the ssget command. I already searched the world wide web for various search keywords, but couldn't find references / lists, especially of the Associative codes and object types. I also read a lot of articles about that command, but most of them use these Associative codes: http://www.lee-mac.com/ssget.html https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2017/ENU/AutoCAD-AutoLISP/files/GUID-0F37CC5E-1559-4011-B8CF-A3BA0973B2C3-htm.html http://www.afralisp.net/autolisp/tutorials/selection-sets.php They Since I am a total newbie with AutoLISP please explain things easily. What I would like to do in the first place is selecting objects via LISP, since there seems to be no command line version of SELECT, QSELECT etc. and therefore I need: a list of "names" of object types that exist in AutoLISP (eg. TEXT, LINE, etc) all neccessary parameters for the ssget function Let's say I want to select a table in a drawing, how can this be done? What if there are more than one tables? Many thanks in advance
MJLM posted a topic in AutoLISP, Visual LISP & DCLCan somebody elaborate a bit about this -4 code and filters with wildcards in a selection set and explain how it really works? I am using the following: (setq pt '(0 0 2.5)) (setq ss (ssget "C" pt pt (list (cons 0 "LINE") (cons -4 "=,=,*") (cons 10 pt)))) My intent is to pick a line that passes through point 'pt' and make a selection set with this one only regardless how many other are crossing behind this line (visually passing through the pt). If I use the following it gives me always nil eventhough my line passes through this point (pt). (setq ss (ssget "C" pt pt (list (cons 0 "LINE") (cons -4 "=,=,=") (cons 10 pt)))) Why is that?