<?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: iLogic class destructor in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7899665#M82799</link>
    <description>&lt;P&gt;No speculation, even? Confirmation this happens? Additional information about when it does or doesn't happen, or workarounds?&lt;/P&gt;</description>
    <pubDate>Sun, 01 Apr 2018 15:39:38 GMT</pubDate>
    <dc:creator>DonStauffer99</dc:creator>
    <dc:date>2018-04-01T15:39:38Z</dc:date>
    <item>
      <title>iLogic class destructor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7892808#M82686</link>
      <description>&lt;P&gt;I created a Finalize method in one of my classes. I instantiate the class in a parameter change rule, so it seems like it should go out of scope after the rule finishes, but the method never executes. Do destructors even work in iLogic classes? Is Finalize the right method name? Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 02:40:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7892808#M82686</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-03-29T02:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic class destructor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7892959#M82687</link>
      <description>&lt;P&gt;Example: I put this code into a rule, and when it runs, the last message box says than n_ is 3. It seems like it should be zero at that point. The messages in the Finalize method never display. It seems like one or the other of them should display 3 times. I have a bigger project, and classes that unload files in their destructor. Those destructors never ran until I put a Save (to disk) function in my code before the objects go out of scope. Then the destructors mostly started running. Why would it be inconsistent like that?&lt;BR /&gt;&lt;BR /&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #008cff;"&gt;ublic&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Class&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;ThisRule&lt;/SPAN&gt;
	&lt;SPAN style="color: #008cff;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;Main&lt;/SPAN&gt;()
		&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;a&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;Counted&lt;/SPAN&gt;
		&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;b&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;Counted&lt;/SPAN&gt;
		&lt;SPAN style="color: #000000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;"creating a"&lt;/SPAN&gt;)
		&lt;SPAN style="color: #000000;"&gt;a&lt;/SPAN&gt; = &lt;SPAN style="color: #008cff;"&gt;Nothing&lt;/SPAN&gt;
		&lt;SPAN style="color: #000000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;"a destroyed"&lt;/SPAN&gt;)
		&lt;SPAN style="color: #000000;"&gt;f&lt;/SPAN&gt;()
		&lt;SPAN style="color: #000000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;"f returned"&lt;/SPAN&gt;)
		&lt;SPAN style="color: #000000;"&gt;b&lt;/SPAN&gt; = &lt;SPAN style="color: #008cff;"&gt;Nothing&lt;/SPAN&gt;
		&lt;SPAN style="color: #000000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;"b destroyed"&lt;/SPAN&gt;)
		
		&lt;SPAN style="color: #000000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;"n="&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="color: #000000;"&gt;Counted&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;n_&lt;/SPAN&gt;.&lt;SPAN style="color: #000000;"&gt;ToString&lt;/SPAN&gt;())
	&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Sub&lt;/SPAN&gt;
	
	&lt;SPAN style="color: #008cff;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;f&lt;/SPAN&gt;()
		&lt;SPAN style="color: #008cff;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;c&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;Counted&lt;/SPAN&gt;
	&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Sub&lt;/SPAN&gt;
&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Class&lt;/SPAN&gt;

&lt;SPAN style="color: #008cff;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Class&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;Counted&lt;/SPAN&gt;
	&lt;SPAN style="color: #008cff;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Shared&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;n_&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Integer&lt;/SPAN&gt; = 0
	&lt;SPAN style="color: #008cff;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;New&lt;/SPAN&gt;()
		&lt;SPAN style="color: #000000;"&gt;n_&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;n_&lt;/SPAN&gt; + 1
	&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Sub&lt;/SPAN&gt;
	&lt;SPAN style="color: #008cff;"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Sub&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;Finalize&lt;/SPAN&gt;()
		&lt;SPAN style="color: #000000;"&gt;n_&lt;/SPAN&gt; = &lt;SPAN style="color: #000000;"&gt;n_&lt;/SPAN&gt; - 1
		&lt;SPAN style="color: #008cff;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #000000;"&gt;n_&lt;/SPAN&gt; = 0 &lt;SPAN style="color: #008cff;"&gt;Then&lt;/SPAN&gt;
			&lt;SPAN style="color: #000000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;"Destroyed!"&lt;/SPAN&gt;)
		&lt;SPAN style="color: #008cff;"&gt;Else&lt;/SPAN&gt;
			&lt;SPAN style="color: #000000;"&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;"Not Destroyed"&lt;/SPAN&gt;)
		&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;if&lt;/SPAN&gt;
	&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Sub&lt;/SPAN&gt;
&lt;SPAN style="color: #008cff;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #008cff;"&gt;Class&lt;/SPAN&gt;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Mar 2018 05:01:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7892959#M82687</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-03-29T05:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic class destructor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7899665#M82799</link>
      <description>&lt;P&gt;No speculation, even? Confirmation this happens? Additional information about when it does or doesn't happen, or workarounds?&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 15:39:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7899665#M82799</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-04-01T15:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic class destructor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7927415#M83167</link>
      <description>&lt;P&gt;Hiya,&lt;/P&gt;&lt;P&gt;In my experience, in a "Try Catch Finally" scenario - the Finally&amp;nbsp;&lt;STRONG&gt;always&lt;/STRONG&gt; fires so you could use that instead?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 10:37:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7927415#M83167</guid>
      <dc:creator>AlexFielder</dc:creator>
      <dc:date>2018-04-12T10:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic class destructor</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7949890#M83552</link>
      <description>&lt;P&gt;That's an interesting idea. I did discover that Microsoft revised VB so it no longer has destructors! This may help work around. Thanks .for the suggestion.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Apr 2018 14:50:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-class-destructor/m-p/7949890#M83552</guid>
      <dc:creator>DonStauffer99</dc:creator>
      <dc:date>2018-04-21T14:50:38Z</dc:date>
    </item>
  </channel>
</rss>

