Lesson32 – Manipulating Selection Sets

Once a selection set is created, a variety of functions can be used to make changes to the selection set or to give you information about it.

Explanation: the (ssxxx) functions

PRACTICE

In this practice you will modify the previous Move and Rotate routine to make sure that you have selected or deselected all the desired objects. Estimated time for completion: 10 minutes.

Steps to the solution

1. Use (ssadd) to add any additional items to the selection set.

2. Use (ssdel) to remove any unwanted items from the selection set.

Solution

(defun C:MoveRotate ()
(setq CE-SAVE (getvar “cmdecho”))
(setvar “cmdecho” 0)
(setq SS (ssget))
(while (setq ENAME (car (entsel “\nAdd any additional items to selection set: “)))
         (ssadd ENAME SS)
)
(while (setq ENAME (car (entsel “\nRemove any unwanted items from the selection set: “)))
          (ssdel ENAME SS)
          )
            (setq CP (getpoint “\nBase point: “))
(setq PT2 (getpoint “\nSecond point: “))
(setq ANG (getdist “\nRotation Angle: “))
(command “move” SS “” CP PT2)
(command “rotate” SS “” PT2 ANG)
(setvar “cmdecho” CE-SAVE)
(princ)
)

  • A complete solution to this exercise is on your class disk as MOVEROTATE-B.LSP

Leave a Reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons
SUBSCRIBE TO OUR NEWSLETTER

It's FREE!

Sign up and receive an email every time a new tutorial is published