<?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: Fusion 360 API Parameter Value does not match Expression in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-360-api-parameter-value-does-not-match-expression/m-p/13439765#M89</link>
    <description>&lt;P&gt;The value property of the Parameter object always uses Fusion's internal units, which are centimeters for length.&lt;/P&gt;&lt;P&gt;1/8" = 0.3175 cm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most of the API works in internal units. The units the user sets for the document are only used when getting or displaying values to the user. For example, you can use the UnitsManager object to convert 0.3175 to a string that uses the current document units and formats it using the user's preferences.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Apr 2025 09:07:47 GMT</pubDate>
    <dc:creator>BrianEkins</dc:creator>
    <dc:date>2025-04-23T09:07:47Z</dc:date>
    <item>
      <title>Fusion 360 API Parameter Value does not match Expression</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-360-api-parameter-value-does-not-match-expression/m-p/13439547#M88</link>
      <description>&lt;P&gt;Apologies if this has been answered, I've just spent 2 hours trying to figure this out and I can't explain it.&lt;/P&gt;&lt;P&gt;I'm pulling parameters using Python script and when I display the parameter value for an expression of 1/8" it shows me 0.3175.&amp;nbsp; Seeing this in several parameter values I've spot checked.&lt;/P&gt;&lt;P&gt;Code Snippet:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;design = adsk.fusion.Design.cast(app.activeProduct)
for parm in design.allParameters:
  if parm.name == "d700":
    app.log(f'debug value: parm.name: {parm.name} value: {parm.value}, str: {str(parm.value)}')
fracVal = 1/8
app.log(f'fracVal = 1/8: {fracVal}')
floatVal = float(1/8)
app.log(f'floatVal = float(1/8): {floatVal}')
d = 1.0/8.0
app.log(f'd = 1.0/8.0: {d}')&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Result:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="general"&gt; debug value: parm.name: d700 value: 0.3175, str: 0.3175
 fracVal = 1/8: 0.125
 floatVal = float(1/8): 0.125
 d = 1.0/8.0: 0.125&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A lot of noise online about floating point precision, which is why I tested the 3 methods to generate a float value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another UserParameter with an expression of 5 1/4", but the value prints as 13.335.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 07:19:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-360-api-parameter-value-does-not-match-expression/m-p/13439547#M88</guid>
      <dc:creator>savaric</dc:creator>
      <dc:date>2025-04-23T07:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Fusion 360 API Parameter Value does not match Expression</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-360-api-parameter-value-does-not-match-expression/m-p/13439765#M89</link>
      <description>&lt;P&gt;The value property of the Parameter object always uses Fusion's internal units, which are centimeters for length.&lt;/P&gt;&lt;P&gt;1/8" = 0.3175 cm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most of the API works in internal units. The units the user sets for the document are only used when getting or displaying values to the user. For example, you can use the UnitsManager object to convert 0.3175 to a string that uses the current document units and formats it using the user's preferences.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 09:07:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-360-api-parameter-value-does-not-match-expression/m-p/13439765#M89</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2025-04-23T09:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Fusion 360 API Parameter Value does not match Expression</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-360-api-parameter-value-does-not-match-expression/m-p/13439832#M90</link>
      <description>&lt;P&gt;I forgot to include a link to the documentation that discusses units in the API.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-A81B295F-984A-4039-B1CF-B449BEE893D7" target="_blank"&gt;https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-A81B295F-984A-4039-B1CF-B449BEE893D7&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 09:28:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-360-api-parameter-value-does-not-match-expression/m-p/13439832#M90</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2025-04-23T09:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Fusion 360 API Parameter Value does not match Expression</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-360-api-parameter-value-does-not-match-expression/m-p/13440676#M91</link>
      <description>&lt;P&gt;Thanks so much Brian for the quick response!&amp;nbsp; This was driving me nuts.&amp;nbsp; Really appreciate the guidance.&lt;/P&gt;&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 16:27:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/fusion-360-api-parameter-value-does-not-match-expression/m-p/13440676#M91</guid>
      <dc:creator>savaric</dc:creator>
      <dc:date>2025-04-23T16:27:12Z</dc:date>
    </item>
  </channel>
</rss>

