Jump to content
hibba

lisp required for selecting objects previous to previous (upto last 5 selections)

Recommended Posts

hibba

Hello guys,

 

i need lisp for selecting objects previous to previous. for example if i move objects multi types with different selection, is there a lisp (or command) that will let me cycle back more than 1 previous selection set (a history of 5 would be good/better than 1.

 

thanks and regards

Share this post


Link to post
Share on other sites
ymg3

hibba,

 

Not a lisp but rather lisp on the fly. Assign your selection set to variables

as you do the selection.

 

When in a command and prompted for a selection set, Typer: (setq ss1 (ssget))

you will then be re-prompted to select the objects. However the set will be

saved in variable ss1 once you complete the selection.

 

To re-use set ss1 that you just created as an input a slection prompt in another command,

you simply type: !ss1

Note the preceding Exclamation Mark.

 

You can use any variable names instead of ss1.

 

Bear in mind that there is a limit on how many selection set can be kept.

Not sure of that limit but I kind of remember 128 sets.

 

ymg

Edited by ymg3

Share this post


Link to post
Share on other sites
BIGAL

A bit more (setq sel1 (ssget "P")) select previous.

 

Maybe try making a list of the selection set so can use the sel1 repeatedly basicly have as many as you want

 

!sels ( ) 3 selections

(nth 0 sels) this was first selection set picked

Share this post


Link to post
Share on other sites
hibba

hello gentle man,

 

i tried but i didn't get the exactly. anyways it will be appreciated if someone create a tutorial and post here so that will be easy to understand.

Share this post


Link to post
Share on other sites
hibba

Hello,

 

Sorry for the previous reply, actually i forgot to type the "!" before ss1. This procedure is also good but i have to save all selection first, after that will work.. if someone create or provide any Lisp for the last five selection so that will be better rather than selecting objects and save with different shortcuts.

 

thanks

Share this post


Link to post
Share on other sites
rashidsohail13

its good work.

but when command prompted and (p) Enter for previous selection for go more previous cycle selection need easy and short way.

because over work small and no wand to save selection many time.

please give a salutation or LISP.

 

 

thanks & regards

Share this post


Link to post
Share on other sites
BIGAL

This will build a list of selection sets use (nth x sels)

(defun C:grabss ( / ss1)
(setq ss1 (ssget "P"))
(setq sels (cons ss1 sels))
(alert (strcat (rtos (length sels) 2 0) " selection sets") )
)

Share this post


Link to post
Share on other sites
rashidsohail13

thanks for reply.

 

i used this LSP and with the help of this LSP i have created 10 different sets of selections. But i don't know which command will be applied for previous selection.

and what the meaning of (nth x sels).

 

 

again thanks.

Share this post


Link to post
Share on other sites
BIGAL

(nth x sels) = ( ) 3 selection sets but only 1 lisp it keeps adding the list of selection sets as you make them

 

The nth command is just that find the objects within the LIST that matches the item number so if you had 3 like above

(nth 0 sels) =

(nth 1 sels) =

(nth 2 sels) =

 

(setq sels nil) will blank the selection set so you can start again.

an example

move !(nth 1 sels) this will find selection set note the ! required to work

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×