Announcements
IMPORTANT. Forum in Read Only mode. You can no longer submit new questions or replies. Please read this message for details
Autodesk Architectural Desktop 2007 & Prior
Welcome to Autodesk’s Autodesk Architectural Desktop 2007 & Prior Forums. Share your knowledge, ask questions, and explore popular Autodesk Architectural Desktop 2007 & Prior topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error: exceeded maximum number of selection sets

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
694 Views, 9 Replies

Error: exceeded maximum number of selection sets

"Error: exceeded maximum number of selection sets" I get this error in AD3
at least
once a day and the only solution is too close out autocad and restart it. It
affects Mpedit and Pljoin as far as I know, but I haven't tried it on other
commands, it is enough to be disruptive. I have SP-2 for AD3 and SP-2 in
Windows 2000
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

Did you ever find a fix for this....I have the same problem?
Message 3 of 10
jharris
in reply to: Anonymous

I'm having the same problem also.
Message 4 of 10
pochrist
in reply to: Anonymous

I don't have it available for posting but search Google groups for ClearSS.lsp or SSclear.lsp They are two rouitnes I got that will fix the problem.
Message 5 of 10
bduchateau
in reply to: Anonymous

You have all been chatting about the selection problem - "Select objects: ; error: exceeded maximum number of selection sets"

I never had this problem with ADT 2004 until LDT 2004 was added to my machine. Then it started. Unfortunately, I don't know what changed to cause this.

Although, the clearSS.lsp fxes he problem when it occurs:

(defun c:clearss ( / i)
(setq i 0)
(foreach x (atoms-family 0)
(if (= (type (eval x)) 'PICKSET)
(progn
(set x NIL)
(setq i (1+ i))
)
)
)
(princ (strcat "\n" (itoa i) " selection set(s) cleared"))
(princ)
);end
Message 6 of 10
gquest
in reply to: Anonymous

Hi,
i have the same problem, but clearss.lsp doen't fix my probem.
Does anybody has found SSCLEAR.LSP?

Here is the code what causes the problem:
(if
(= "TEXT" (cdr (assoc 0 sstr)))
(progn
(setq x_point (nth 0 (cdr (assoc 10 sstr))))
(setq x_point_ (nth 0 (cdr (assoc 11 sstr))))
(if (> x_point x_val) ;LEFT
(progn
(ssadd (car thandle_) work_set)
(command "_.justifytext" work_set "" "Left")
(ssdel (car thandle_) work_set)

(setq sstr__ (entget (car thandle_)))
(setq x_point (nth 0 (cdr (assoc 10 sstr__))))
(setq x_point_ (nth 0 (cdr (assoc 11 sstr__))))
(setq x_dist (- x_val x_point))
(setq move_ (list x_dist 0.0))

(ssadd (car thandle_) work_set)
(command "_.move" work_set "" move_ "")
(ssdel (car thandle_) work_set)
(setq sstr__ nil)
)
)
Any ideas how to solve it?
Regards
Message 7 of 10
Anonymous
in reply to: Anonymous

I assume that is not the entire routine. At some point prior to running the code you posted, the variable work_set has been set up as a selection set. The various ssadd and ssdel functions add and remove members from the set, but even if the set contains no members at the end of the routine, it is still a selection set and counts against the maximum number.

Your routine should set work_set to nil when it is done, to release that selection set.

--

David Koch
Autodesk Discussion Group Facilitator
Message 8 of 10
gquest
in reply to: Anonymous

Hello David,
here is the whole code:

(defun c:talign_ ()

(setq thandle (list)); text handle
(setq thandle_ (list)); text handle working list
(setq x_dist 0.0000)
(setq x_val 0.0000)
(setq work_set (ssadd))
(setq _set_ (ssadd)); create empty selection set

(setq x_val (- (nth 0 (nth 1 (entsel "\nPick a Line to align to : \n"))) 0))

(if
(= (setq Ent (entsel "\nSelect TEXT to align\n")) nil)
(progn
(setq pt1 (getpoint "\nNothing Selected! \nSelection Window: \nFirst Point \n"))
(terpri)
(setq pt2 (getcorner "second Point" pt1))
(terpri)
(setq _set_ (ssget "_W" pt1 pt2))
(terpri)
);end progn
(ssadd (car Ent) _set_); add object handle to empty selection set
);end if
(setq setlen (sslength _set_))
(setq counter 0)
(repeat setlen
(setq ent (ssname _set_ counter))
(setq sstr (entget ent))
(if ; TEXT
(= (cdr (assoc 0 sstr)) "TEXT")
(setq thandle
(append thandle
(list
(cdr (assoc -1 sstr))
)
)
)
); end if text
(setq counter (1+ counter))
);end von repeat setlen
(setq _set_ nil)

(setq thandle_ thandle)
(repeat (length thandle)
(setq sstr__ nil)
(setq sstr (entget (car thandle_)))
(if
(= "TEXT" (cdr (assoc 0 sstr)))
(progn
(setq x_point (nth 0 (cdr (assoc 10 sstr))))
(if (> x_point x_val) ;LEFT
(progn
(ssadd (car thandle_) work_set)
(command "_.justifytext" work_set "" "LEFT")
(ssdel (car thandle_) work_set)

(setq sstr__ (entget (car thandle_)))
(setq x_point (nth 0 (cdr (assoc 10 sstr__))))
(setq x_point_ (nth 0 (cdr (assoc 11 sstr__))))
(setq x_dist 0)
(setq x_dist (- x_val x_point))
(setq move_ (list x_dist 0.0))
(ssadd (car thandle_) work_set)
(command "_.move" work_set "" move_ "")
(ssdel (car thandle_) work_set)
(setq sstr__ nil)
)
)
(if (< x_point x_val) ;RIGHT
(progn
(ssadd (car thandle_) work_set)
(command "_.justifytext" work_set "" "Right")
(ssdel (car thandle_) work_set)

(setq sstr__ (entget (car thandle_)))
(setq x_point (nth 0 (cdr (assoc 10 sstr__))))
(setq x_point_ (nth 0 (cdr (assoc 11 sstr__))))
(setq x_dist 0)
(setq x_dist (- x_val x_point_))
(setq move_ (list x_dist 0.0))
(ssadd (car thandle_) work_set)
(command "_.move" work_set "" move_ "")
(ssdel (car thandle_) work_set)
(setq sstr__ nil)

)
);end von if
); end orogn
); end if
(setq thandle_ (cdr thandle_))
); end repeat len thandle
(setq thandle nil)
(setq thandle_ nil)
(setq work_set nil)
(setq _set_ nil)
(princ); silent end
)

After 4 or 5 times running this routine i get an ads error:
ADS ERROR: Exceeded maximum number of selection sets, even
running stuff like clearss.lsp doesn't fix this problem. The only
way is to restart autocad. My question: is there any way to clear
the memory or to reset the whole selection set variable, means
after resetting i start with selection set 0 again, without restarting autocad.

Regards,
Gernot Janschewski
Message 9 of 10
gquest
in reply to: Anonymous

Hello David,
it seems there is a problem with TEXTJUSTIFY. I found an other
method in one of lisp routine archives. I've modified my code, replaced
the textjustify with the same method used in tj.lsp and it works.
Somehow under certain circumcenses textjustfy doesn't release
a selection set.

(defun c:talign_ ()

(setq thandle (list)); text handle
(setq thandle_ (list)); text handle working list
(setq x_dist 0.0000)
(setq x_val 0.0000)
(setq work_set (ssadd))
(setq _set_ (ssadd)); create empty selection set

(setq x_val (- (nth 0 (nth 1 (entsel "\nPick a Line to align to : \n"))) 0))

(if
(= (setq Ent (entsel "\nSelect TEXT to align\n")) nil)
(progn
(setq pt1 (getpoint "\nNothing Selected! \nSelection Window: \nFirst Point \n"))
(terpri)
(setq pt2 (getcorner "second Point" pt1))
(terpri)
(setq _set_ (ssget "_W" pt1 pt2))
(terpri)
);end progn
(ssadd (car Ent) _set_); add object handle to empty selection set
);end if
(setq setlen (sslength _set_))
(setq counter 0)
(repeat setlen
(setq ent (ssname _set_ counter))
(setq sstr (entget ent))
(if ; TEXT
(= (cdr (assoc 0 sstr)) "TEXT")
(setq thandle
(append thandle
(list
(cdr (assoc -1 sstr))
)
)
)
); end if text
(setq counter (1+ counter))
);end von repeat setlen
(setq _set_ nil)

(setq thandle_ thandle)
(repeat (length thandle)
(setq sstr__ nil)
(setq sstr (entget (car thandle_)))
(if
(= "TEXT" (cdr (assoc 0 sstr)))
(progn
(setq x_point (nth 0 (cdr (assoc 10 sstr))))
(if (> x_point x_val) ;LEFT
(progn
;-------------------------------------
; modified section. source: tj.lsp
(setq f (assoc 72 sstr))
(setq p11 (assoc 11 sstr))
(setq p10 (assoc 10 sstr))
(if (= (cdr f) 0)
(progn
(setq p11n (cons 11 (cdr p10)))
(setq sstr (subst p11n p11 sstr))
)
)
(if (/= (cdr f) 0)
(progn
(setq p10n (cons 10 (cdr p11)))
(setq sstr (subst p10n p10 sstr))
)
)
(setq fn 0)
(setq fn (cons 72 fn))
(setq sstr (subst fn f sstr))
(entmod sstr)
;------------------------------------

(setq sstr__ (entget (car thandle_)))
(setq x_point (nth 0 (cdr (assoc 10 sstr__))))
(setq x_point_ (nth 0 (cdr (assoc 11 sstr__))))
(setq x_dist 0)
(setq x_dist (- x_val x_point))
(setq move_ (list x_dist 0.0))
(ssadd (car thandle_) work_set)
(command "_.move" work_set "" move_ "")
(ssdel (car thandle_) work_set)
(setq sstr__ nil)
)
)
(if (< x_point x_val) ;RIGHT
(progn
;---------------------------------------
; modified section. source: tj.lsp
(setq f (assoc 72 sstr))
(setq p11 (assoc 11 sstr))
(setq p10 (assoc 10 sstr))
(if (= (cdr f) 0)
(progn
(setq p11n (cons 11 (cdr p10)))
(setq sstr (subst p11n p11 sstr))
)
)
(if (/= (cdr f) 0)
(progn
(setq p10n (cons 10 (cdr p11)))
(setq sstr (subst p10n p10 sstr))
)
)
(setq fn 2)
(setq fn (cons 72 fn))
(setq sstr (subst fn f sstr))
(entmod sstr)
;---------------------------------------

(setq sstr__ (entget (car thandle_)))
(setq x_point (nth 0 (cdr (assoc 10 sstr__))))
(setq x_point_ (nth 0 (cdr (assoc 11 sstr__))))
(setq x_dist 0)
(setq x_dist (- x_val x_point_))
(setq move_ (list x_dist 0.0))
(ssadd (car thandle_) work_set)
(command "_.move" work_set "" move_ "")
(ssdel (car thandle_) work_set)
(setq sstr__ nil)

)
);end von if
); end orogn
); end if
(setq thandle_ (cdr thandle_))
); end repeat len thandle
(setq thandle nil)
(setq thandle_ nil)
(setq work_set nil)
(setq _set_ nil)
(princ); silent end
)

Regards,
Gernot Janschewski
Message 10 of 10
gquest
in reply to: Anonymous

there is a small error:
wrong:
(setq x_val (- (nth 0 (nth 1 (entsel "\nPick a Line to align to : \n"))) 0))
right:
(setq x_val (nth 1 (assoc 10 (entget (car (entsel "\nPick a Line to align to : \n"))))))

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report