<?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: If parameter is greater than zero then run this rule in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/if-parameter-is-greater-than-zero-then-run-this-rule/m-p/12781596#M10054</link>
    <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/415009"&gt;@kwilson_design&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Total_Length&lt;/SPAN&gt; &amp;gt; 0 &lt;SPAN&gt;Then&lt;/SPAN&gt; 
  &lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;RunRule&lt;/SPAN&gt;(&lt;SPAN&gt;"Calculate ERP Amount If Total_Length is extrusion"&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;/PRE&gt;</description>
    <pubDate>Sat, 18 May 2024 01:35:46 GMT</pubDate>
    <dc:creator>BM_Ashraf</dc:creator>
    <dc:date>2024-05-18T01:35:46Z</dc:date>
    <item>
      <title>If parameter is greater than zero then run this rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/if-parameter-is-greater-than-zero-then-run-this-rule/m-p/12781456#M10053</link>
      <description>&lt;P&gt;In short, I'm trying to trigger a custom iProperty to be used is a parameter called "Total_Length" is greater than zero, or 0.000 to be specific.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a an existing rule that is called "Calculate ERP Amount Conversion" and it's a simple code that writes to a custom iProperty named ERP Amount that I'm also rounding down to 3 place decimal.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"ERP Amount"&lt;/SPAN&gt;) = &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"ERP_Amount_Conversion"&lt;/SPAN&gt;)
&lt;SPAN&gt;iProperties&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt;(&lt;SPAN&gt;"Custom"&lt;/SPAN&gt;, &lt;SPAN&gt;"ERP Amount"&lt;/SPAN&gt;) = &lt;SPAN&gt;Round&lt;/SPAN&gt;(&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"ERP_Amount_Conversion"&lt;/SPAN&gt;), 3)&lt;/PRE&gt;&lt;P&gt;Anyways, what I'm trying to do is that if a user parameter named "Total_Length" is greater than zero, then run the above code, otherwise allow the custom iProperty "ERP Amount" to remain editable for manual data entry instead of relying on the data from the user parameter. Hope that makes sense lol.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems pretty straight forward, and I'm sure it is, but I'm running into a syntax snag when trying to do this with If Then End If statements. There may be a better way to achieve what I'm trying to do in the original code for all I know and I'm open to any suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"Total_Length"&lt;/SPAN&gt;) &amp;gt; 0.000
	&lt;SPAN&gt;Then&lt;/SPAN&gt; 
&lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;RunRule&lt;/SPAN&gt;(&lt;SPAN&gt;"Calculate ERP Amount If Total_Length is extrusion"&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Above is what I've got so far but I'm getting the syntax error on Line 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rule Compile Errors in Catch, in Test.ipt&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error on Line 2 : Syntax error.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2024 00:25:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/if-parameter-is-greater-than-zero-then-run-this-rule/m-p/12781456#M10053</guid>
      <dc:creator>kwilson_design</dc:creator>
      <dc:date>2024-05-18T00:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: If parameter is greater than zero then run this rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/if-parameter-is-greater-than-zero-then-run-this-rule/m-p/12781596#M10054</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/415009"&gt;@kwilson_design&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Total_Length&lt;/SPAN&gt; &amp;gt; 0 &lt;SPAN&gt;Then&lt;/SPAN&gt; 
  &lt;SPAN&gt;iLogicVb&lt;/SPAN&gt;.&lt;SPAN&gt;RunRule&lt;/SPAN&gt;(&lt;SPAN&gt;"Calculate ERP Amount If Total_Length is extrusion"&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;/PRE&gt;</description>
      <pubDate>Sat, 18 May 2024 01:35:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/if-parameter-is-greater-than-zero-then-run-this-rule/m-p/12781596#M10054</guid>
      <dc:creator>BM_Ashraf</dc:creator>
      <dc:date>2024-05-18T01:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: If parameter is greater than zero then run this rule</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/if-parameter-is-greater-than-zero-then-run-this-rule/m-p/12787418#M10055</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/9690327"&gt;@BM_Ashraf&lt;/a&gt;&amp;nbsp;that fixed it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 14:06:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/if-parameter-is-greater-than-zero-then-run-this-rule/m-p/12787418#M10055</guid>
      <dc:creator>kwilson_design</dc:creator>
      <dc:date>2024-05-21T14:06:23Z</dc:date>
    </item>
  </channel>
</rss>

