Sets which objects are selected and gripped
(sssetfirst gripset[pickset])
The gripset argument is ignored; the selection set of objects specified by pickset are selected and gripped.
You are responsible for creating a valid selection set. For example, you may need to verify that a background paper space viewport (DXF group code 69) is not included in the selection set. You may also need to ensure that selected objects belong to the current layout, as in the following code:
(setq ss (ssget (list (cons 410 (getvar "ctab")))))
The selection set or sets specified.
First, draw a square and build three selection sets. Begin by drawing side 1 and creating a selection set to include the line drawn:
Command: (entmake (list (cons 0 "line") '(10 0.0 0.0 0.0)'(11 0.0 10.0 0.0)))
((0 . "line") (10 0.0 0.0 0.0) (11 0.0 10.0 0.0))
Command: (setq pickset1 (ssget "_l"))
<Selection set: a5>
Variable pickset1 points to the selection set created.
Draw side 2 and add it to the pickset1 selection set:
Command: (entmake (list (cons 0 "line") '(10 0.0 10.0 0.0)'(11 10.0 10.0 0.0)))
((0 . "line") (10 0.0 10.0 0.0) (11 10.0 10.0 0.0))
Command: (ssadd (entlast) pickset1)
<Selection set: a5>
Create another selection set to include only side 2:
Command: (setq 2onlyset (ssget "_l"))
<Selection set: a8>
Draw side 3 and add it to the pickset1 selection set:
Command: (entmake (list (cons 0 "line") '(10 10.0 10.0 0.0)'(11 10.0 0.0 0.0)))
((0 . "line") (10 10.0 10.0 0.0) (11 10.0 0.0 0.0))
Command: (ssadd (entlast) pickset1)
<Selection set: a5>
Create another selection and include side 3 in the selection set:
Command: (setq pickset2 (ssget "_l"))
<Selection set: ab>
Variable pickset2 points to the new selection set.
Draw side 4 and add it to the pickset1 and pickset2 selection sets:
Command: (entmake (list (cons 0 "line") '(10 10.0 0.0 0.0)'(11 0.0 0.0 0.0)))
((0 . "line") (10 10.0 0.0 0.0) (11 0.0 0.0 0.0))
Command: (ssadd (entlast) pickset1)
<Selection set: a5>
Command: (ssadd (entlast) pickset2)
<Selection set: ab>
At this point, pickset1 contains sides 1-4, pickset2 contains sides 3 and 4, and 2onlyset contains only side 2.
Turn grip handles on and select all objects in pickset1:
Command: (sssetfirst nil pickset1)
(nil <Selection set: a5>)
Turn grip handles on and select all objects in pickset2:
Command: (sssetfirst nil pickset2)
(nil <Selection set: ab>)
Turn grip handles on and select all objects in 2onlyset:
Command: (sssetfirst nil 2onlyset)
(nil <Selection set: a8>)
Each sssetfirst call replaces the gripped and selected selection set from the previous sssetfirst call.
-
The ssget and ssgetfirst functions.