Jump to content

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


hibba

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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") )
)

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

(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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...