+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
  1. #1
    Full Member sachindkini's Avatar
    Computer Details
    sachindkini's Computer Details
    Operating System:
    xp
    Using
    AutoCAD 2008
    Join Date
    Nov 2007
    Location
    india (mumbai)
    Posts
    96

    Question It’s possible AutoCad selection save (s1, s2, etc.) & after some time reuse

    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.

  2. #2
    Senior Member Geobuilder's Avatar
    Computer Details
    Geobuilder's Computer Details
    Operating System:
    Windows 7 Professional
    CPU:
    Intel(R) Corel(TM) i7 860 @ 2.80GHz 2.80 GHz
    RAM:
    8 GB DDR2
    Graphics:
    NVIDIA GeForce GTS 250 (Microsoft Corporation - WDDM v1.1)
    Monitor:
    22 "
    Using
    AutoCAD 2013
    Join Date
    Jan 2010
    Location
    Russia, Siberia
    Posts
    205

    Default

    Of course, but!
    Quote Originally Posted by help
    Selection sets consume AutoCAD temporary file slots, so AutoLISP is not permitted to have more than 128 open at one time.
    and they exist only in a single session, ie closed\open and they're gone: (
    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.

  3. #3
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,729

    Default

    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

  4. #4
    Senior Member ILoveMadoka's Avatar
    Using
    AutoCAD 2012
    Join Date
    Oct 2008
    Posts
    213

    Default

    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...

  5. #5
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2009
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,587

    Default

    Quote Originally Posted by sachindkini View Post
    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
    Another way to create groups separately for the particular selection set
    These woul stored in the current drawing
    See Help file about

    ~'J'~
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  6. #6
    Full Member sachindkini's Avatar
    Computer Details
    sachindkini's Computer Details
    Operating System:
    xp
    Using
    AutoCAD 2008
    Join Date
    Nov 2007
    Location
    india (mumbai)
    Posts
    96

    Default

    Quote Originally Posted by fixo View Post
    Another way to create groups separately for the particular selection set
    These woul stored in the current drawing
    See Help file about

    ~'J'~
    Quote Originally Posted by ILoveMadoka View Post
    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...
    DEAR SIR,

    THX FOR HELP ME..
    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.

  7. #7
    Senior Member ILoveMadoka's Avatar
    Using
    AutoCAD 2012
    Join Date
    Oct 2008
    Posts
    213

    Default

    Glad to help someone (Finally!!)

  8. #8
    Senior Member Geobuilder's Avatar
    Computer Details
    Geobuilder's Computer Details
    Operating System:
    Windows 7 Professional
    CPU:
    Intel(R) Corel(TM) i7 860 @ 2.80GHz 2.80 GHz
    RAM:
    8 GB DDR2
    Graphics:
    NVIDIA GeForce GTS 250 (Microsoft Corporation - WDDM v1.1)
    Monitor:
    22 "
    Using
    AutoCAD 2013
    Join Date
    Jan 2010
    Location
    Russia, Siberia
    Posts
    205

    Default

    Quote Originally Posted by ILoveMadoka View Post
    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...
    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 "")


    Quote Originally Posted by Lee Mac View Post
    I think TimSpangler wrote something that would facilitate this a while back.
    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.

  9. #9
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2011
    Join Date
    Apr 2008
    Posts
    6,007

    Default

    (Can't sleep)
    Here's a way...

    You'll need this subroutine: http://www.cadtutor.net/forum/showpo...8&postcount=13
    Code:
    ;;; 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
    Here's something similar I did: http://www.cadtutor.net/forum/showthread.php?t=45215
    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...

  10. #10
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,729

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Geobuilder View Post
    Well ... me, in principle, it is not necessary, just curious, where can I see this (written by TimSpangler)
    I think I saw it on theSwamp.org a while back
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. open autocad took more time
    By muthu123 in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 23rd Mar 2010, 01:25 pm
  2. Save Editing Time to a log file
    By sachindkini in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 17th Dec 2009, 08:43 am
  3. Help: Can't save a FILTER selection set
    By StykFacE in forum AutoCAD General
    Replies: 7
    Last Post: 6th May 2009, 07:16 pm
  4. Replies: 7
    Last Post: 29th Dec 2008, 01:31 pm
  5. A Weekend AutoCAD Hip Tip to Save You Time
    By Lynn Allen's Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 10th Sep 2007, 05:11 am

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