Error - number of Selection set exceeds

Discussion in 'AutoCAD' started by shyam, Feb 11, 2004.

  1. shyam

    shyam Guest

    I am using a AutoLISP for our work. Lot of times AutoCAD shows an error message - number of selection set exceeds. We have a lot of selection set defined in the AutoLISP.

    Is there any way to overcome this...
    Is there any buffer which can be increased...

    Please help. thanks.
     
    shyam, Feb 11, 2004
    #1
  2. shyam

    hendie Guest

    you are limited to a maximum of 128 selection sets in acad. there is now way to increase this.
    what you should be doing is releasing the selection set after you have used it, otherwise you are tying up your resources. as you have now found
     
    hendie, Feb 11, 2004
    #2
  3. shyam

    nagesh nangi Guest

    see memory management funcion topic in vlisp help

    Nagesh

    message - number of selection set exceeds. We have a lot of selection set
    defined in the AutoLISP.
     
    nagesh nangi, Feb 11, 2004
    #3
  4. shyam

    TCEBob Guest

    I guess you are referring to (gc) -- which the help on selection sets
    also suggests. Unhappily, it doesn't work in this case. It's not the
    amount of memory but the presence of 128 selection sets that sets the
    error. Several people have written routines to reset. One worked in
    previous versions but will not in 04.

    The only option that I know of is to reload the drawing. That can be
    best done by saving and going straight to files/load and picking the
    same drawing.

    There are 2 reasons why the ssets build up: 1)poorly written lisps which
    do not release the sset variable. (setq sset nil) during each iteration
    of a loop. 2) the tendency of users to <esc> from a routine before it
    ends. Really good lisps have an error handler defined to handle this. A
    virtue rarely embraced by even the canniest programmer.

    rs
     
    TCEBob, Feb 11, 2004
    #4
  5. shyam

    nagesh nangi Guest

    thnks for clarifying my misunderstanding.
     
    nagesh nangi, Feb 11, 2004
    #5
  6. but if you declare those ss variables local, they should be gone with an escape??

    "TCEBob" <>
    |>I guess you are referring to (gc) -- which the help on selection sets
    |>also suggests. Unhappily, it doesn't work in this case. It's not the
    |>amount of memory but the presence of 128 selection sets that sets the
    |>error. Several people have written routines to reset. One worked in
    |>previous versions but will not in 04.
    |>
    |>The only option that I know of is to reload the drawing. That can be
    |>best done by saving and going straight to files/load and picking the
    |>same drawing.
    |>
    |>There are 2 reasons why the ssets build up: 1)poorly written lisps which
    |>do not release the sset variable. (setq sset nil) during each iteration
    |>of a loop. 2) the tendency of users to <esc> from a routine before it
    |>ends. Really good lisps have an error handler defined to handle this. A
    |>virtue rarely embraced by even the canniest programmer.
    |>
    |>rs
    |>
    |>|>> see memory management funcion topic in vlisp help
    |>>
    |>> Nagesh
    |>>
    |>> |>> > I am using a AutoLISP for our work. Lot of times AutoCAD shows an
    |>error
    |>> message - number of selection set exceeds. We have a lot of selection
    |>set
    |>> defined in the AutoLISP.
    |>> >
    |>> > Is there any way to overcome this...
    |>> > Is there any buffer which can be increased...
    |>> >
    |>> > Please help. thanks.
    |>>
    |>>
    |>

    James Maeding
    Civil Engineer/Programmer
     
    James Maeding, Feb 12, 2004
    #6
  7. shyam

    TCEBob Guest

    an escape??

    No, the subroutine has to complete before the interpreter releases any
    variables.

    rs
     
    TCEBob, Feb 12, 2004
    #7
  8. shyam

    Jeff Mishler Guest

    No, the subroutine has to complete before the interpreter releases any
    Not so fast, Bob......
    Using this little test, and it's brother with ss included as a local
    var:

    (defun test ()
    (setq ss (ssget))
    (if ss
    (getstring "\nPress escape now....")
    )
    )

    Gives these results:

    press ESC when asked:
    Command: !ss
    <Selection set: 11>

    Just hit enter:
    Command: !ss
    <Selection set: 11>


    With ss localized.....
    press ESC when asked:
    Press escape now....*Cancel*
    ; error: Function cancelled
    Command: !ss
    nil

    Just hit enter:
    Press escape now....
    ""
    Command: !ss
    nil

    So it seems ACAD does cleanup the local vars, unless I've got an error
    handler somewhere that is not the stock ACAD one.....

    Jeff
     
    Jeff Mishler, Feb 13, 2004
    #8
  9. shyam

    TCEBob Guest

    Works here. Didn't used to. I missed the memo. Thanks for the info. So
    now the prime reason for sset overflow must be careless programming. My
    specialty.

    rs
     
    TCEBob, Feb 13, 2004
    #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.