TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: domenicomaria on July 22, 2022, 03:37:05 AM
-
I need to make "previous" a selection set.
(setq ss1 (ssget) )
(setq ss2 (ssget) )
I need that ss1 must be the "previous" selection set
But
(command "move" "p" "")
moves ss2 and not ss1.
To solve it i use :
(defun SS
-MAKE
-PREVIOUS
(ss
/ ohl
) ss
)
But it is not elegant, because I have to use "command" or "vl-cmdf" . . .
Is there another solution ?
-
(setq ss1 (ssget))
(setq ss2 (ssget))
(sssetfirst nil nil)
(sssetfirst nil ss1)
(ssget "_P") ;;; => selected ss1 instead of ss2
But here it's better this :
(ssget "_I") ;;; => implied selection - always useful after (sssetfirst nil ss) which highlights selection set ss...
-
Do you mean the current selected items?
Then you can use:
Or the actual items selected for the last function, you can use:
Also here is a very helpful reference: http://www.lee-mac.com/ssget.html
Edit: Aah, ribarm beat me by 2 minutes, I need to type quicker :oops:
-
so this one could be the solution
(defun SS-MAKE-PREVIOUS (ss) (sssetfirst nil ss) (ssget "_I") )
-
Why not move ss1 ?
You should be able to make multiple selection sets and use SET to make them like SS+x as variable name so could have as many as you want then can use same method to retrieve sss+x in move SS1. Not tested very hard.
(setq x 12)
(setq pt1 '(0 0 0) pt2 '(100 100 0))
(set (read (strcat "SS" (rtos x 2 0))) (ssget))
(vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "move !ss" (rtos x 2 0) " " " " "!pt1 " "!pt2 "))
-
sometimes a lisp routine
does some things and creates or modifies some objects.
For the user, after using this routine
it can be useful to easily select
all new objects created or modified.
So from the command line
for example he can say:
move previous
-
irneb posted SelectResults.lsp at https://forums.augi.com/showthread.php?81175-select-result-lisp-modification#5 (https://forums.augi.com/showthread.php?81175-select-result-lisp-modification#5) which creates selection sets of objects produced by commands with a reactor so you can select them easily. Lisp needs to be loaded when you open a drawing.
In the lisp set $Result-Length to how many previous sets you want to keep.
-
try:
(setq ss2 (ssget) ) ; 1
(setq ss1 (ssget) ) ; 2 > previous
(command "move" "p" "")
-
try:
(setq ss2 (ssget) ) ; 1
(setq ss1 (ssget) ) ; 2 > previous
(command "move" "p" "")
Marco, I'm sorry, but I don't understand your answer . . .
the PREVIOUS selection set, is latest thing that SSGET returns . . .
But I need to MAKE PREVIOUS, ANOTHER selection set . . .
-
try:
(setq ss2 (ssget) ) ; 1
(setq ss1 (ssget) ) ; 2 > previous
(command "move" "p" "")
Marco, I'm sorry, but I don't understand your answer . . .
the PREVIOUS selection set, is latest thing that SSGET returns . . .
But I need to MAKE PREVIOUS, ANOTHER selection set . . .
Ok… sorry, ignore my reply. ;) :oops: