CALCAD Posted September 13, 2010 Posted September 13, 2010 Do selection sets remain in memory if not explicitly set nil within the lisp application? I ask this question because of what I read in help : From the Autocad 2008 help file : "When an application has finished using a selection set, it is important to release it from memory. You can do this by setting it to nil: (setq ss1 nil)" I have always explicitly set selection sets to nil within my lisp programs. Is this unnecessary? Quote
Lee Mac Posted September 13, 2010 Posted September 13, 2010 Localising the variable will release the selectionset from memory, as this is effectively setting the variable to nil. I believe, when the ActiveDocument is closed all the variables stored in the document namespace will be released anyway. Quote
CALCAD Posted September 13, 2010 Author Posted September 13, 2010 Hi Lee, You may remember some time ago you questioned my practice of setting the selection sets to nil and I finally got around to looking it up in Autocad help. I still think the statement in the help file is ambiguous, but your answer seems reasonable and I appreciate it. Thanks very much. Quote
David Bethel Posted September 14, 2010 Posted September 14, 2010 If I remember correctly, at one time there was a limit of 128 active ( boundp ) selection sets in one session. I would hope that limitation is gone by now. Even using old software, I very seldom run into a crash with that error. -David Quote
BIGAL Posted September 14, 2010 Posted September 14, 2010 When debugging its a pain if you forget to reset your selection sets else you get an error VBA does this also, often endup whilst debugging set1 set2 set3 etc final code set1 it easier to change one word in code and run again. Also same with lists playing with some code at moment each time I run the list contains the same stuff but in multiple times will add a set to nil today Quote
Tharwat Posted September 14, 2010 Posted September 14, 2010 Also with Visual Lisp codes it is recommended to delete the Selection Set at the end of a routine with this function . (vla-delete selectionSet) Tharwat Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.