<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Exceeded Maximum Selection Sets in a .Net / Lisp Combo in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6875979#M32977</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;JHoward_HOB wrote:&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;FONT color="#808080"&gt;&lt;EM&gt;&amp;lt; .. &amp;gt;&lt;/EM&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;The source of the problem was (one of)&amp;nbsp;my return results buffers. I was creating my own typed value of 5007 SelectionSet and sending that back as my function result. After creating that typed value I was indeed disposing the original selection set, but it apparently&amp;nbsp;didn't matter....&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;Resolution: NEVER send a typed value of type&amp;nbsp;SelectionSet back in a result buffer!!! AutoCAD will not release the reference even when it gets Nil'd on the receiving lisp end. So, I just decided to return a list of ObjectID's (enames) and used (Acet-List-To-SS) to quick convert it into a selection set that&amp;nbsp;lisp could continue operating with.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;JHoward_HOB,&lt;/P&gt;
&lt;P&gt;Would you please do us all a favour and post a project with the minimum working code to demonstrate the issue you describe.&lt;/P&gt;
&lt;P&gt;I would expect that someone from AutoDesk will pass the issue to their technical people. ( Perhaps it could be passed via any ADN contacts you have).&lt;/P&gt;
&lt;P&gt;If the situation you outline can be confirmed/reproduced consistently, that may go a long way towards getting the issue fixed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2017 08:02:42 GMT</pubDate>
    <dc:creator>kerry_w_brown</dc:creator>
    <dc:date>2017-02-14T08:02:42Z</dc:date>
    <item>
      <title>Exceeded Maximum Selection Sets in a .Net / Lisp Combo</title>
      <link>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6839369#M32974</link>
      <description>&lt;P&gt;First of all, I know what I am doing is not&amp;nbsp;practical, but it is&amp;nbsp;necessary&amp;nbsp;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Scenario&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;I have a production lisp routine that uses .Net API's to bolster its functionality. During some tasks (primarily large models), I may use these routines a LOT. Eventually it starts spitting out "maximum number of selection sets" errors. A Close/Save on the&amp;nbsp;drawing and re-opening it does resolve the issue just fine, but these are frequently very large drawings that take some time to save/close/open. Ultimately&amp;nbsp;I really just want to squash the bug moving forward!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;LISP&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Within the lisp routines I am localizing the SelectionSet variables and for good measure&amp;nbsp;I am&amp;nbsp;setting those variables to Nil when I am done with them. In addition to that I am calling the&amp;nbsp;(GC) function directly after&amp;nbsp;nulling those variables. Couple more things to note are the Document/SelectionSets VLA object has a Count of zero and the manual act of (setq ss (ssget)) would actually put a SelectionSet into the ss variable. So, at this point&amp;nbsp;I don't think the problem technically has anything to do with lisp....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;.NET&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;The SelectionSet is typically provided by lisp in a&amp;nbsp;ResultsBuffer to the .Net functions. From there I convert&amp;nbsp;those TypedValues to actual&amp;nbsp;Selection Sets. Once I have completely finished working with&amp;nbsp;that .Net SelectionSet I immediately call the Dispose() method on it; every time..... I didn't find&amp;nbsp;any kind of SelectionSet Manager while using the search features of the Visual Studio&amp;nbsp;Object Browser. So, at this point&amp;nbsp;I really don't know how to clean house more than I currently am.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody have any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI: I did already see the other Maximum SS&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/error-exceeded-maximum-number-of-selection-sets/m-p/2490048#M277441" target="_self"&gt;thread&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 04:39:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6839369#M32974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-30T04:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Exceeded Maximum Selection Sets in a .Net / Lisp Combo</title>
      <link>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6873601#M32975</link>
      <description>&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;.NET&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;My understanding is that calling .Dispose() doesn't actually dispose the object right away, but marks it ready for disposal - and the garbage collector release those resources when it sees fit. which might be today, or next Christmas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot solve the fundamental problem - because i don't know the intriciate internal workings of AutoCad, but I might suggest something which you might not have previously considered:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Why not store the selections in a more persistent form: XML, JSON etc - that way you&amp;nbsp;can have a million selection sets if you want. use the object's handle to refer to the object. You'll have to store and read but there are libraries that are readily available, and it might alleviate the immediate problem somewhat.&lt;/LI&gt;&lt;LI&gt;Or perhaps you could redesign your code to more efficiently use resources?&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im afraid those are the only things i can suggest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;good luck. would be interested to hear the solution if you do manage to find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 12:07:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6873601#M32975</guid>
      <dc:creator>BKSpurgeon</dc:creator>
      <dc:date>2017-02-13T12:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exceeded Maximum Selection Sets in a .Net / Lisp Combo</title>
      <link>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6875866#M32976</link>
      <description>&lt;P&gt;BK, you have an interesting way of thinking and I was certainly considering some home grown version&amp;nbsp;of your brilliant alternative if I couldn't find the root of the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you did do is have me digging super deep into typed values to see if there was another way to get to the "selected object" without actually casting it into a SelectionSet type and that was a cool exercise. I tried just about every version of&amp;nbsp;enumerating I could muster, but eventually it was&amp;nbsp;me bypassing everything to see if just sending (many) selection sets into a lisp function in the first place was the source of the problem..... Then I found it &lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The source of the problem was (one of)&amp;nbsp;my return results buffers. I was creating my own typed value of 5007 SelectionSet and sending that back as my function result. After creating that typed value I was indeed disposing the original selection set, but it apparently&amp;nbsp;didn't matter....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Resolution: NEVER send a typed value of type&amp;nbsp;SelectionSet back in a result buffer!!! AutoCAD will not release the reference even when it gets Nil'd on the receiving lisp end. So, I just decided to return a list of ObjectID's (enames) and used (Acet-List-To-SS) to quick convert it into a selection set that&amp;nbsp;lisp could continue operating with.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 06:52:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6875866#M32976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-14T06:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Exceeded Maximum Selection Sets in a .Net / Lisp Combo</title>
      <link>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6875979#M32977</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;JHoward_HOB wrote:&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;FONT color="#808080"&gt;&lt;EM&gt;&amp;lt; .. &amp;gt;&lt;/EM&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;The source of the problem was (one of)&amp;nbsp;my return results buffers. I was creating my own typed value of 5007 SelectionSet and sending that back as my function result. After creating that typed value I was indeed disposing the original selection set, but it apparently&amp;nbsp;didn't matter....&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;Resolution: NEVER send a typed value of type&amp;nbsp;SelectionSet back in a result buffer!!! AutoCAD will not release the reference even when it gets Nil'd on the receiving lisp end. So, I just decided to return a list of ObjectID's (enames) and used (Acet-List-To-SS) to quick convert it into a selection set that&amp;nbsp;lisp could continue operating with.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;JHoward_HOB,&lt;/P&gt;
&lt;P&gt;Would you please do us all a favour and post a project with the minimum working code to demonstrate the issue you describe.&lt;/P&gt;
&lt;P&gt;I would expect that someone from AutoDesk will pass the issue to their technical people. ( Perhaps it could be passed via any ADN contacts you have).&lt;/P&gt;
&lt;P&gt;If the situation you outline can be confirmed/reproduced consistently, that may go a long way towards getting the issue fixed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 08:02:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6875979#M32977</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2017-02-14T08:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Exceeded Maximum Selection Sets in a .Net / Lisp Combo</title>
      <link>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6876034#M32978</link>
      <description>&lt;P&gt;Well, this is a production routine, but I can probably whip something up that will replicate the problem. I have some tight deadlines on a project to worry about for a while, but I will put that on my to do list.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 08:35:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6876034#M32978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-14T08:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Exceeded Maximum Selection Sets in a .Net / Lisp Combo</title>
      <link>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6876528#M32979</link>
      <description>&lt;P&gt;for those looking at this post in future:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/autocad/2012/08/lispfunction-examples-for-autolisp-to-net.html" target="_blank"&gt;http://adndevblog.typepad.com/autocad/2012/08/lispfunction-examples-for-autolisp-to-net.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seems that Gilles had suggested the very same solution - if you read the comment at the bottom of the link.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 12:47:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exceeded-maximum-selection-sets-in-a-net-lisp-combo/m-p/6876528#M32979</guid>
      <dc:creator>BKSpurgeon</dc:creator>
      <dc:date>2017-02-14T12:47:54Z</dc:date>
    </item>
  </channel>
</rss>

