+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Full Member hibba's Avatar
    Using
    AutoCAD 2013
    Join Date
    Dec 2013
    Posts
    33

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

    Registered forum members do not see this ad.

    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

  2. #2
    Senior Member ymg3's Avatar
    Using
    not applicable
    Join Date
    May 2011
    Posts
    414

    Default

    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
    Last edited by ymg3; 29th Dec 2015 at 03:40 am.

  3. #3
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,577

    Default

    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 (<Selection set: 8> <Selection set: d> <Selection set: f>) 3 selections
    (nth 0 sels) <Selection set: 8> this was first selection set picked
    A man who never made mistakes never made anything

  4. #4
    Full Member hibba's Avatar
    Using
    AutoCAD 2013
    Join Date
    Dec 2013
    Posts
    33

    Default

    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.

  5. #5
    Full Member hibba's Avatar
    Using
    AutoCAD 2013
    Join Date
    Dec 2013
    Posts
    33

    Default

    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

  6. #6
    Junior Member
    Using
    AutoCAD 2014
    Join Date
    Dec 2013
    Posts
    11

    Default

    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

  7. #7
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,577

    Default

    This will build a list of selection sets use (nth x sels)
    Code:
    (defun C:grabss ( / ss1)
    (setq ss1 (ssget "P"))
    (setq sels (cons ss1 sels))
    (alert (strcat (rtos (length sels) 2 0) " selection sets") )
    )
    A man who never made mistakes never made anything

  8. #8
    Junior Member
    Using
    AutoCAD 2014
    Join Date
    Dec 2013
    Posts
    11

    Default

    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.

  9. #9
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,577

    Default

    (nth x sels) = (<Selection set: 8> <Selection set: d> <Selection set: f>) 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) = <Selection set: 8>
    (nth 1 sels) = <Selection set: d>
    (nth 2 sels) = <Selection set: f>

    (setq sels nil) will blank the selection set so you can start again.
    an example
    move !(nth 1 sels) this will find selection set <Selection set: d> note the ! required to work
    A man who never made mistakes never made anything

  10. #10
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    813

    Default

    Registered forum members do not see this ad.

    http://forums.augi.com/showthread.ph...modification#5
    Is what I've been using.
    Modify $Result-Length to the number of previous sets of entities to save.

Similar Threads

  1. Create selection set for previous objects
    By broncos15 in forum AutoLISP, Visual LISP & DCL
    Replies: 15
    Last Post: 3rd Dec 2015, 03:57 pm
  2. Previous Plot Lisp help needed...
    By Saqib_theleo in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 6th Dec 2012, 12:47 pm
  3. Can lisp tell which previous plot driver you have?
    By muck in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 6th Jan 2010, 01:40 pm
  4. Viewing how Previous Objects were Created.
    By Jon B in forum AutoCAD General
    Replies: 8
    Last Post: 14th May 2008, 05:41 pm
  5. Reselecting Previous Selections
    By mecatec in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 18
    Last Post: 5th Mar 2008, 04:55 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts