ssget
(ssget [ method ] [ point1 [ point2 ] ] [
pointList ] [ filterList ] )
This function starts an interactive or
non-interactive entity selection depending on method and the specific
optional point and filter arguments.
Arguments
|
method (string, optional) specified the selection method
(see Remarks); if not specified, a user-interactive selection is
done
point1 (2d/3d point, optional) specifies the pick point or
the first corner of crossing / windowing selection
point2 (2d/3d point, optional) specifies the second corner
of crossing / windowing selection
pointList (list of 2d/3d points, optional) specifies the list
of polygon points for all polygon selection modes
filterList (list, optional) filter to be applied to the created
selectionset (post-processing the initially found
selectionset)
|
Return
|
returns a selectionset
(pickset), or NIL is selection failed
|
Example
|
(setq ss (ssget '((0 .
"POINT"))))
interactive selection by user, then filters
and returns only POINT entities in selectionset
(setq ss (ssget "I" (list (cons 0
"CIRCLE"))))
uses the already picked/selected entities
(pickfirst set), then filters and returns only CIRCLE entities in
selectionset
(setq ss (ssget "C" p1 p2 '((8 .
"Basement"))))
creates a selectionset in "crossing" mode
using the 2 points p1 and p2, then filters and returns only
entities from layer "Basement"
(setq ss (ssget "X" (list (cons 0 "INSERT")
(cons 62 "ByLayer")))))
creates a selectionset from
entire database, filters and collects only BlockReferences with
color "ByLayer"
|
Remarks
|
method :
A AllVisible entities mode
B Box mode
O Outside
mode
OP OutsidePolygon mode
F Fence mode
I PickFirst mode
L Last entity
P Previously active
selectionset
C Crossing mode
CP CrossingPolygon mode
W Window mode
WP WindowPolygon mode
X Database mode
:E Everything within aperture box around
cursor position
:N Nested entity selection
:S Single selection only
:D Duplicates allowed (not
supported)
:U Enables subentity
selection
:V Forced subentity selection
if method
is NIL, then a point selection is processed at
specified point1
filterList : a
list of dotted-pairs ("filter item") of format (dxfCode . value),
similar to the (entget) list format;
each dotted pair entry contains a required
condition for the found entities; all conditions are applied in AND
logic
'((0 . "LINE") (62 . 5)) selects only
LINE entities, with color 5
for string values, wildcards are
allowed;
"filter items" can be combined by logical and
relational operators; both logical and relational filter items are
specified by a -4 dxf Code
logical filter expressions :
"<AND" item ... item "AND>" all
filter items are combined via logical "AND" (all conditions must
match)
"<OR" item ... item
"OR>" all filter items are combined via logical "OR"
operation (1 matching condition is sufficient)
"<XOR" itemA itemB
"XOR>" 2 filter items are combined via logical "XOR"
operation (1 and only 1 condition must match)
"<NOT" item "NOT>"
the filter item is used in inverted logic (condition does not
match)
example : (ssget
"X" '((-4 . "<OR") (0 . "CIRCLE") (0 . "LINE") (-4 . "OR>")))
selects all circle and line entities
relational filter expressions :
"*" wildcard for "all"
"=" equal
"!=" not equal
"/=" not equal
"<>" not
equal
"<" less than
"<=" less than or
equal
">" greater
than
">=" greater than or
equal
example : (ssget
"X" '((0 . "ARC") (-4 . "<") (40 . 5.0))) selects all arc
entities with a radius less then 5.0
|