TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lee Mac on May 07, 2009, 05:12:16 PM
-
I know using such a code for logical conditionals such as:
(-4 . "<OR") (-4 . "OR>")
(-4 . "<AND") (-4 . "AND>")
(-4 . "<XOR") (-4 . "XOR>")
(-4 . "<NOT") (-4 . "NOT>")
etc etc
But recently, I have seen it used in the following way:
(0 . "CIRCLE")
(-4 . "*,=,*")
(assoc 10 dxf_ent)
where "dxf_ent" is the (entget) return for another Circle.
I was just wondering, what is the deal with this "-4" group code? Is there somewhere a list of all the possibilities in which it can be used?
Your input and advice is much appreciated 8-)
Cheers
Lee :lol:
-
Look in the help for ' selection set filter lists '. These are what they help is calling ' Relation tests '. Here is a quick cut from the help.
Relational operators for selection set filter lists
Operator
Description
"*"
Anything goes (always true)
"="
Equals
"!="
Not equal to
"/="
Not equal to
"<>"
Not equal to
"<"
Less than
"<="
Less than or equal to
">"
Greater than
">="
Greater than or equal to
"&"
Bitwise AND (integer groups only)
"&="
Bitwise masked equals (integer groups only)
-
Cheers Tim, I'll check that out :-)
-
Cheers Tim, I'll check that out :-)
You're welcome.
-
An old thread:
http://www.theswamp.org/index.php?topic=1333.msg16766#msg16766
Here are some examples I have tucked away:
=======================================================================
CAB 03.29.08
get any nornal that is not 0 0 1
(setq ss (ssget "X" '((-4 . "<NOT")(210 0.0 0.0 1.0)(-4 . "NOT>")(-4 . "*,*,*")(210 0.0 0.0 1.0))))
=======================================================================
Example by CAB
Find a circle with a given center point
If the center point of the circle & the start point of the plines are the same this will get them.
(setq mdn (ssget "x" (list '(0 . "circle") (append '(10) stp))) )
If you need some wiggle room try this: [ignoring the z]
(setq wiggle 0.05)
(setq mdn (ssget "x" (list '(0 . "circle")
'(-4 . ">,*,*") (list 10 (- (car stp) wiggle) 0 0)
'(-4 . "<,*,*") (list 10 (+ (car stp) wiggle) 0 0)
'(-4 . "*,>,*") (list 10 0 (- (cadr stp) wiggle) 0)
'(-4 . "*,<,*") (list 10 0 (+ (cadr stp) wiggle) 0)
) )
)
Reads like this:
(if (and (> (center x) (- (pt x) wiggle))
(< (center x) (+ (pt x) wiggle))
(> (center y) (- (pt y) wiggle))
(< (center y) (+ (pt y) wiggle))
)
============================================================
Example by Luis uses a list of points
(setq filter (append (list '(-4 . "<AND") '(0 . "AECC_POINT") '(-4 . "<OR"))
(mapcar (function (lambda (x) (cons 90 x)))
num_list
)
(list '(-4 . "OR>") '(-4 . "AND>"))
)
)
(ssget "X" filter)
============================================================
-
Thanks CAB, some nice examples there :-)