Of course, but!
and they exist only in a single session, ie closed\open and they're gone: (Originally Posted by help
Registered forum members do not see this ad.
Dear All,
It’s possible AutoCad selection save (s1, s2, s3 etc.) & after some time
reuse the selection sets inside some lisp or inside a command
Just like Photoshop selection
Skip the bottled water.Use a water filter to purify tap water instead of buying bottled water. Not only is bottled water expensive, but it generates large amounts of container waste.
Of course, but!
and they exist only in a single session, ie closed\open and they're gone: (Originally Posted by help
On this site I not only study AutoCAD but I also practice my English. If you find rough grammatical errors in my messages, please inform me with a personal message.
I think TimSpangler wrote something that would facilitate this a while back.![]()
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
At the Command: prompt type this...
(setq ss1 (ssget))
Select your objects.
This creates a selection set called ss1.
To retrieve (or reuse) the selection set just type !ss1 at any Select Objects: prompt.
Once you close the drawing the selection set is gone like the others have said.
You can do this at anytime from the command prompt.
I had several selection sets like this written into my in my menu.
Hope this helps...
Skip the bottled water.Use a water filter to purify tap water instead of buying bottled water. Not only is bottled water expensive, but it generates large amounts of container waste.
I do not know how it was in previous versions, but in 2010 does not happen, ie (setq ss1 (ssget)) works, but the Select Objects: ss1 - no, writes *Invalid selection*, but if you first select(highlight) selection (sssetfirst nil ss1), and then apply it to any command that all is well.
Or put in command line this (vl-cmdf "command name" ss1 "") for example (vl-cmdf "_move" ss1 "")
Well ... me, in principle, it is not necessary, just curious, where can I see this (written by TimSpangler)
Last edited by Geobuilder; 26th Mar 2010 at 06:44 am.
On this site I not only study AutoCAD but I also practice my English. If you find rough grammatical errors in my messages, please inform me with a personal message.
(Can't sleep)
Here's a way...
You'll need this subroutine: http://www.cadtutor.net/forum/showpo...8&postcount=13
Here's something similar I did: http://www.cadtutor.net/forum/showthread.php?t=45215Code:;;; Stored Selection Sets ;;; Required Subroutines: AT:ListSelect ;;; Alan J. Thompson, 03.26.10 (defun c:SSS (/ #Choice #Name #SS) (vl-load-com) (or *SSS:Option* (setq *SSS:Option* "Store")) (initget 0 "Recall rEmove Store") (if (vl-consp *SSS:Sets*) (setq *SSS:Option* (cond ((getkword (strcat "\nStore Selection Sets\nSpecify option. [Recall/rEmove/Store] <" *SSS:Option* ">: " ) ;_ strcat ) ;_ getkword ) (*SSS:Option*) ) ;_ cond ) ;_ setq (setq *SSS:Option* "Store") ) ;_ if (cond ((eq *SSS:Option* "Recall") (if (vl-consp *SSS:Sets*) (and (setq #Choice (car (AT:ListSelect "Recall Stored Selection Sets" "Select Selection Set:" "10" "10" "false" (vl-sort (mapcar 'car *SSS:Sets*) '<) ) ;_ AT:ListSelect ) ;_ car ) ;_ setq (if (vl-position (getvar 'cmdactive) '(1 2)) (and (setq SSS (cdr (assoc #Choice *SSS:Sets*))) (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) (vla-sendcommand *AcadDoc* "!SSS ") ) ;_ and (sssetfirst nil (cdr (assoc #Choice *SSS:Sets*))) ) ;_ if ) ;_ and (alert "No selection sets stored!") ) ;_ if ) ((eq *SSS:Option* "rEmove") (if (vl-consp *SSS:Sets*) (and (setq #Choice (AT:ListSelect "Remove Stored Selection Sets" "Select Selection Set(s):" "10" "10" "true" (vl-sort (mapcar 'car *SSS:Sets*) '<) ) ;_ AT:ListSelect ) ;_ setq (progn (foreach x #Choice (setq *SSS:Sets* (vl-remove (assoc x *SSS:Sets*) *SSS:Sets*))) (print #Choice) (princ (strcat "\n" (itoa (length #Choice)) " stored selection set(s) removed.")) ) ;_ progn ) ;_ and (alert "No selection sets stored!") ) ;_ if ) ((eq *SSS:Option* "Store") (and (/= "" (setq #Name (strcase (getstring t (strcat (if (vl-consp *SSS:Sets*) (strcat "\nStored Selection Sets: " (vl-princ-to-string (vl-sort (mapcar 'car *SSS:Sets*) '<)) ) ;_ strcat "" ) ;_ if "\nSelection set name: " ) ;_ strcat ) ;_ getstring ) ;_ strcase ) ;_ setq ) ;_ /= (or (not (vl-position #Name (mapcar (function car) *SSS:Sets*))) (alert (strcat "Sorry, \"" #Name "\" is already a stored selection set.")) ) ;_ or (setq #SS (ssget)) (setq *SSS:Sets* (cons (cons #Name #SS) *SSS:Sets*)) (princ (strcat "Selection set \"" #Name "\" stored.")) ) ;_ and ) ) ;_ cond (princ) ) ;_ defun
Last edited by alanjt; 26th Mar 2010 at 04:02 pm. Reason: Updated code
DropBox | finding the light...
Seann: ...it went crazy ex-girlfriend on me...
eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...
Registered forum members do not see this ad.
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Bookmarks