How much maximum number of selection sets

Discussion in 'AutoCAD' started by Adesu, Mar 8, 2005.

  1. Adesu

    Adesu Guest

    In "Error code " catalog (Appendix C--AutoLISP Error Codes) I've got table
    value 3 ,this meaning is exceeded maximum number of selection sets,my
    question is ,how much maximum number of selection sets?
     
    Adesu, Mar 8, 2005
    #1
  2. Adesu

    Adesu Guest

    Hi Jeff,thanks.

     
    Adesu, Mar 8, 2005
    #2
  3. Adesu

    Adesu Guest

    Hi Jeff,is it my script true or wrong?
    (setq ss (ssget "x" '((0 . "LINE"))))
    (if ss
    (= (getvar "errno") 3)
    (alert "\nYOUR CHOOSE,OVER THE MAXIMUM NUMBER OF SELECTION SETS"))
     
    Adesu, Mar 8, 2005
    #3
  4. Not Jeff.... but....

    If you are testing code do something like this:

    Code:
    
    (setq ss nil) ;; this will avoid the error message you are getting
    
    (if (setq ss (ssget "x" '((0 . "LINE"))))
    (progn
    
    ;; do whatever here...
    
    ))
    
    
    
     
    Luis Esquivel, Mar 8, 2005
    #4
  5. Adesu

    Adesu Guest

    Hi Luis,I want error work and how error work,not avoid from error message
     
    Adesu, Mar 8, 2005
    #5
  6. Adesu

    Jeff Mishler Guest

    Hi Ade,
    Try this little routine that will exceed the number of SelSets and report
    the error to you. Then use the second one to clear them out. This should
    give you the answers you are looking for.

    (defun c:sstest (/ count *error*)
    (defun *error* (msg)
    (princ (strcat "\nError message: " msg))
    (princ (strcat "\nError number: " (itoa (getvar "errno"))))
    )
    (setq count 0)
    (repeat 150
    (setq count (1+ count))
    (set (read (strcat "ss" (itoa count))) (ssget "x"))
    )
    )

    (defun c:ssclear ()
    (vl-load-com)
    (foreach x (atoms-family 1)
    (if (= (type (eval (read x))) 'PICKSET)
    (set (read x) nil)
    )
    )
    (vlax-for x (vla-get-selectionsets
    (vla-get-activedocument
    (vlax-get-acad-object)))
    (vla-delete x)
    )
    (gc)
    (princ)
    )

    --
    Jeff
    check out www.cadvault.com
     
    Jeff Mishler, Mar 8, 2005
    #6
  7. Adesu

    Adesu Guest

    Hi Jeff, yes that is I'm looking for,thanks very much for your spend time to
    answer my question

     
    Adesu, Mar 8, 2005
    #7
  8. One thing to keep in mind here, the user DID NOT exceed the maximum number
    of selection sets. The custom programming exceeding the maximum number of
    selection sets. The user can run Autocad all day long and will never run out
    of selection sets, UNLESS he ran some custom programming that did not free
    them when it was done. When you create a selection set, you should nil it
    out when you are done with it, also nil it out before you use it, just in
    case it wasnt set to nil by the last program that used it.
     
    Randy Sanders, Mar 8, 2005
    #8
  9. yep, just love those programmers who think global vars are the way to go.
    One more reason to keep things local.

    "Randy Sanders" <7om>
    |>One thing to keep in mind here, the user DID NOT exceed the maximum number
    |>of selection sets. The custom programming exceeding the maximum number of
    |>selection sets. The user can run Autocad all day long and will never run out
    |>of selection sets, UNLESS he ran some custom programming that did not free
    |>them when it was done. When you create a selection set, you should nil it
    |>out when you are done with it, also nil it out before you use it, just in
    |>case it wasnt set to nil by the last program that used it.
    |>

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Mar 9, 2005
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.