ssget
(ssget [mode] [point1 [point2]] [point_list] [filter])
The ssget function creates a new selection set.
Arguments
mode
Selection mode. The mode argument specifies the method to apply for entity selection.
You can set mode to one of the following values:
Mode |
Meaning |
- |
The interactive selection mode has started prompting the user to specify entities. |
"_C" |
Crossing |
"_CP" |
Crossing Polygon |
"_F" |
Fence |
"_I" |
Implied selection (entities selected while PICKFIRST is in effect and a preselection set is active). |
"_L" |
Last entity |
"_P" |
Previous selection set |
"_W" |
Window |
"_WP" |
Window Polygon |
"_X" |
Filtered Selection |
point1 / point2
point1 / point2 may point to a drawing point or to a list of drawing points.
The variable mode controls the appropriate interpretation:
- If you specify the selection modes "_C" and "_W", point1 and point2 contain the coordinates required for the selection window.
- If you specify "_CP", "_WP", or "_F", point1 must point to a list of drawing points that form the polygon to select the drawing entities; in this case point2 is ignored.
filter
Association list. Filter containing additional selection criteria. For example, you can specify certain entity types, entity properties, coordinate areas, etc. in the filter list. Geometric as well as non-geometric criteria allow flexible selection methods.
point_list
List of points defining a polygon or fence.
Relational Tests
The special group code -4 allows numerical comparison. Any relational test must be invoked with this code. The value of the group code is a string specifying the operator.
Logical Operators
Logical operators are also specified via a group code -4. In this case the group code is used to start and to terminate an expression for logical comparison. Starting the operation is indicated by a '<' sign before the operator keyword (e.g. "<OR") as first expression in a list containing the contents of the logical comparison. Termination of the comparison expression is signaled by a '>' behind the operator keyword (e.g. "OR>").
The following possibilities also may be used nested:
...'((-4 . "<AND") [expression1] ...(-4 . "AND>")) ...'((-4 . "<OR") [expression1] ...(-4 . "OR>")) ...'((-4 . "<XOR") [expression1] ...(-4 . "XOR>")) ...'((-4 . "<NOT") [expression1] (-4 . "NOT>"))
Return Value
If the function fails, it returns nil.
(ssget)
(ssget '(10 10))
(ssget "_X")
(ssget "_I") ; Returns a selection set of all pre-selected entities
(ssget "_I" '((0 . "LINE"))) ; Returns a selection set of all pre-selected line entities
(ssget "_P")
(ssget "_L")
(ssget "_W" '(0 0) '(100 100))
(ssget "_WP" '((0 0) (0 100) (100 0)))
(ssget "_F" '((0 0) (15 15) (15 0)))
(ssget "X" '((0 . "LINE"))) ; selects all lines (ssget "X" '((0 . "CIRCLE") (8 "0"))
(ssget "_C" '(0 0) '(10 10) '((0 . "CIRCLE"))) ; all circles crossing the window 0,0 10,10
(ssget "X" '( (-4 . "<OR")
(-4 . "<AND")(0 . "TEXT")(40 . 10)(-4 . "AND>")
(0 . "CIRCLE")
(-4 . "OR>")))
(ssget "X" '((0 . "TEXT") (-4 "=") (40 . 10)))