<?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 iLogic Parameter value is wrong in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-value-is-wrong/m-p/6908964#M102794</link>
    <description>&lt;P&gt;Hi guys!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't use the parameter value in a formula because it sends the wrong value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value will show as the wrong one if it's alone but combined with the unit it's good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's something I must be missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Made a dummy assembly for you guys to have a look&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2017 13:34:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-02-28T13:34:39Z</dc:date>
    <item>
      <title>iLogic Parameter value is wrong</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-value-is-wrong/m-p/6908964#M102794</link>
      <description>&lt;P&gt;Hi guys!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't use the parameter value in a formula because it sends the wrong value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value will show as the wrong one if it's alone but combined with the unit it's good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's something I must be missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Made a dummy assembly for you guys to have a look&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 13:34:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-value-is-wrong/m-p/6908964#M102794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-28T13:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter value is wrong</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-value-is-wrong/m-p/6909066#M102795</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Grabbing parameters VALUES will always return the value in DATABASE UNITS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as length goes, the value returned will be converted to cm. So you need to write in your code to convert it back.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck,&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 14:08:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-value-is-wrong/m-p/6909066#M102795</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-02-28T14:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter value is wrong</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-value-is-wrong/m-p/6909321#M102796</link>
      <description>&lt;P&gt;so lenght is Always in cm,&lt;/P&gt;
&lt;P&gt;angles are Always in Radians&lt;/P&gt;
&lt;P&gt;Mass in Kilogram&lt;/P&gt;
&lt;P&gt;Time in second&lt;/P&gt;
&lt;P&gt;temperature in Kelvin...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ways to convert:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;oUM.LengthUnits = &lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;UnitsTypeEnum&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;.kInchLengthUnits&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Dim&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; slon222 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Double&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; = oUM.ConvertUnits(oUM.GetValueFromExpression(oCD.Parameters.UserParameters.Item(&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"LONGUEUR_MAITRE"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;).expression, &lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;UnitsTypeEnum&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;.kInchLengthUnits), &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"cm"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"in"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Dim&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; slon223 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Double&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; = oUM.ConvertUnits((oCD.Parameters.UserParameters.Item(&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"LONGUEUR_MAITRE"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;).value), &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"cm"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;, oUM.LengthUnits)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GetValueFromExpression&amp;nbsp;&amp;nbsp; will Always give a value in cm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;specifying a unittype is only usefull if the expression has no unit.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 15:10:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-value-is-wrong/m-p/6909321#M102796</guid>
      <dc:creator>HermJan.Otterman</dc:creator>
      <dc:date>2017-02-28T15:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic Parameter value is wrong</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-value-is-wrong/m-p/11599172#M102797</link>
      <description>&lt;P&gt;Late reply years later but figured this could help someone in the future&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to simply add a mathematical express at the end of my original value being returned and it did indeed work.&amp;nbsp; I needed my value in inches but was getting it in CM.&amp;nbsp; So I just added "/2.54" since 1In = 2.54CM.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See my code for full context of how I used this within my own application, in which I needed to append material parameters to my filename after running a For Each loop where each file is saved as a separate DXF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SheetMetalComponentDefinition&lt;/SPAN&gt; = &lt;SPAN&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;THK&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;"_"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oCompDef&lt;/SPAN&gt;.&lt;SPAN&gt;Parameters&lt;/SPAN&gt;(&lt;SPAN&gt;"d0"&lt;/SPAN&gt;).&lt;SPAN&gt;Value&lt;/SPAN&gt;.&lt;SPAN&gt;ToString&lt;/SPAN&gt;/2.54 &amp;amp; &lt;SPAN&gt;".dxf"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 18:33:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-parameter-value-is-wrong/m-p/11599172#M102797</guid>
      <dc:creator>pflaquerGCPB2</dc:creator>
      <dc:date>2022-12-05T18:33:18Z</dc:date>
    </item>
  </channel>
</rss>

