<?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 Parameter function behaviour in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7366611#M98242</link>
    <description>&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;did you try to "Round" the parameter before the compair?&lt;/P&gt;
&lt;P&gt;I had some issues where 3 is not 3, but 3.000000001134252..&lt;/P&gt;</description>
    <pubDate>Sat, 09 Sep 2017 07:17:07 GMT</pubDate>
    <dc:creator>HermJan.Otterman</dc:creator>
    <dc:date>2017-09-09T07:17:07Z</dc:date>
    <item>
      <title>iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357611#M98233</link>
      <description>&lt;P&gt;In the attached part, I don't understand why these two rules produce a different result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Rule 1&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;If Parameter("glass") = 21.5 Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;MsgBox("Standard")&lt;BR /&gt;Else&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;MsgBox("Non-Standard")&lt;BR /&gt;End If&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Message&amp;nbsp;&lt;/STRONG&gt;- Non-Standard&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Rule 2&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;If glass = 21.5 Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;MsgBox("Standard")&lt;BR /&gt;Else&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;MsgBox("Non-Standard")&lt;BR /&gt;End If&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Message&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;-&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Standard&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt;I need&amp;nbsp;to use the Parameter("glass") format as it's going to be an external rule, but I'm totally &lt;SPAN&gt;miffed as to why its producing the result it is&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone able to provide some insight?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:28:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357611#M98233</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-06T09:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357682#M98234</link>
      <description>&lt;P&gt;I feel like its not considering the decimal values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change that to some whole numbers and check once its working fine. Don't know exactly why its not taking decimal values.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:57:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357682#M98234</guid>
      <dc:creator>b_sharanraj</dc:creator>
      <dc:date>2017-09-06T09:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357690#M98235</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/850872"&gt;@b_sharanraj&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not that... Try it with 17.5 instead of 21.5 and it works as it should&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 09:59:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357690#M98235</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-06T09:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357691#M98236</link>
      <description>&lt;P&gt;You can try like below code it may help you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Temp_Glass&lt;/SPAN&gt; &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;Single&lt;/SPAN&gt;
&lt;SPAN&gt;Temp_Glass&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Glass&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; 

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Temp_Glass&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;21.5&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&l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MT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357691#M98236</guid>
      <dc:creator>b_sharanraj</dc:creator>
      <dc:date>2017-09-06T10:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357704#M98237</link>
      <description>&lt;P&gt;Works normally when I change the value to 20.5 or 22.5. It doesn't like 21.5&amp;nbsp;&lt;img id="smileymad" class="emoticon emoticon-smileymad" src="https://forums.autodesk.com/i/smilies/16x16_smiley-mad.png" alt="Smiley Mad" title="Smiley Mad" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 10:07:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357704#M98237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-06T10:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357707#M98238</link>
      <description>&lt;P&gt;Your method does work around the problem, thanks for that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm hoping someone at Autodesk can confirm if this is a bug?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 10:09:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357707#M98238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-06T10:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357709#M98239</link>
      <description>&lt;P&gt;Bravo&amp;nbsp;@Anonymous&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You find out a bug&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;Yes&amp;nbsp;it have some problem only with 21.5&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 10:09:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357709#M98239</guid>
      <dc:creator>b_sharanraj</dc:creator>
      <dc:date>2017-09-06T10:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357978#M98240</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's already an interesting thread&amp;nbsp;on this kind of rounding problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/attack-Of-the-DoubleForEquals/td-p/5808334" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/attack-Of-the-DoubleForEquals/td-p/5808334&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(be warned its quite a complex thread!)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To summarise it - the issue is already logged as a bug with Autodesk. The suggested workaround to reduce these problems is to declare parameter values as Decimal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Dim b As Decimal = Parameter("glass")&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although here's a couple more alternatives for you if you'd rather not have to 'Dim' your parameter on a separate line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Alternative 1:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;c&amp;nbsp;=&amp;nbsp;Parameter.Param("glass").Value&amp;nbsp;*&amp;nbsp;10&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;This is so-called 'advanced iLogic syntax' and it gets you access to the parameter object in the API. Note you would have to multiply by 10 if you’re working in mm (due to Inventor’s internal units of cm)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Alternative 2:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;d&amp;nbsp;=&amp;nbsp;ThisApplication.ActiveEditDocument.ComponentDefinition.Parameters("glass").Value&amp;nbsp;*&amp;nbsp;10&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;' This is pure API code - obviously the path to the parameter object can be shortened!&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Luke&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 12:11:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7357978#M98240</guid>
      <dc:creator>LukeDavenport</dc:creator>
      <dc:date>2017-09-06T12:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7358846#M98241</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I should also have pointed out that for&amp;nbsp;&lt;STRONG&gt;Alternative&amp;nbsp;1 and 2&amp;nbsp;&lt;/STRONG&gt;above you don't actually need to declare the parameter value, so you don't need to write (for instance):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Dim c As Decimal =&amp;nbsp;Parameter.Param("glass").Value&amp;nbsp;*&amp;nbsp;10&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can simply write:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;c&amp;nbsp;=&amp;nbsp;Parameter.Param("glass").Value&amp;nbsp;*&amp;nbsp;10&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If anyone is interested in the reason for this, its because the methods shown in&amp;nbsp;&lt;STRONG&gt;Alternative&amp;nbsp;1 and 2&amp;nbsp;&lt;/STRONG&gt;return a Double object (for numeric 'dimension' parameters), which compares fine with other numbers, but the&amp;nbsp;&lt;STRONG&gt;Parameter("glass")&amp;nbsp;&lt;/STRONG&gt;method returns an iLogic DoubleForEquals object - which doesn't currently play well when compared to other numbers.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 15:52:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7358846#M98241</guid>
      <dc:creator>LukeDavenport</dc:creator>
      <dc:date>2017-09-06T15:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7366611#M98242</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;did you try to "Round" the parameter before the compair?&lt;/P&gt;
&lt;P&gt;I had some issues where 3 is not 3, but 3.000000001134252..&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2017 07:17:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7366611#M98242</guid>
      <dc:creator>HermJan.Otterman</dc:creator>
      <dc:date>2017-09-09T07:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter function behaviour</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7383043#M98243</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/977473"&gt;@LukeDavenport&lt;/a&gt;&amp;nbsp;Thanks for the insight Luke, I can work with one of these methods.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 10:53:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-function-behaviour/m-p/7383043#M98243</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-15T10:53:17Z</dc:date>
    </item>
  </channel>
</rss>

