<?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 User Parameter in Extrude in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/user-parameter-in-extrude/m-p/9329919#M12640</link>
    <description>&lt;P&gt;How do I add a user defined parameter to an extrusion. I have the parameter defined and I know how to do this when defining a sketch, I just can't seem to figure out how it works with an extrusion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Feb 2020 05:00:16 GMT</pubDate>
    <dc:creator>MartinCrawford-DTLD</dc:creator>
    <dc:date>2020-02-20T05:00:16Z</dc:date>
    <item>
      <title>User Parameter in Extrude</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/user-parameter-in-extrude/m-p/9329919#M12640</link>
      <description>&lt;P&gt;How do I add a user defined parameter to an extrusion. I have the parameter defined and I know how to do this when defining a sketch, I just can't seem to figure out how it works with an extrusion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 05:00:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/user-parameter-in-extrude/m-p/9329919#M12640</guid>
      <dc:creator>MartinCrawford-DTLD</dc:creator>
      <dc:date>2020-02-20T05:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: User Parameter in Extrude</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/user-parameter-in-extrude/m-p/9329926#M12641</link>
      <description>&lt;P&gt;For the input argument that defines the length of the extrusion, create a ValueInput object as a string where the string is the name of the parameter.&amp;nbsp; Here's a simple example that assumes a parameter called "Length" already exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;# Define that the extent the value of the parameter "Length".
distance = adsk.core.ValueInput.createByString('Length')

# Create the extrusion.
extrudes = rootComp.features.extrudeFeatures
ext = extrudes.addSimple(prof, distance, adsk.fusion.FeatureOperations.NewComponentFeatureOperation)&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Feb 2020 05:13:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/user-parameter-in-extrude/m-p/9329926#M12641</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2020-02-20T05:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: User Parameter in Extrude</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/user-parameter-in-extrude/m-p/9331161#M12642</link>
      <description>&lt;P&gt;Thanks for the quick response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may have not been clear in my request, this assigns the value from the User Defined Parameter, however what I was wanting to accomplish was to assign the Parameter to the extrusion, so later if I needed to update a value I could without re-running the script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the sketch, I did the following:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;displayWidth = parameter.expression = &lt;/SPAN&gt;&lt;SPAN&gt;'DisplayWidth'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there an&amp;nbsp;equivalent way with an extrusion.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 20 Feb 2020 15:44:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/user-parameter-in-extrude/m-p/9331161#M12642</guid>
      <dc:creator>MartinCrawford-DTLD</dc:creator>
      <dc:date>2020-02-20T15:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: User Parameter in Extrude</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/user-parameter-in-extrude/m-p/9700406#M12643</link>
      <description>&lt;P&gt;I'm having the same issue, when referencing a user parameter inside a 'createByString' function, it's "flattened". The expression is computed correctly, but when I open the extrude feature from the timeline, the value it's extruded by is simply the result of the expression. I would expect it to function the same way as from inside the GUI, where you type '&lt;SPAN&gt;Playfield_thickness&amp;nbsp;-&amp;nbsp;0.25&amp;nbsp;in' into a value input, the reference is saved and updates to the parameter are reflected in the feature.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example, here's a snippet of the code I'm using for my extrude:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;param_playfield_thickness_value = adsk.core.ValueInput.createByString("0.5 in")
design.userParameters.add("Playfield_thickness", param_playfield_thickness_value, "in", "The thickness of the playfield")

# ...

second_extrude_depth = adsk.core.ValueInput.createByString('Playfield_thickness - 0.25 in')
second_extrude = extrudes.addSimple(shelf_profile, second_extrude_depth, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When 'Playfield_thickness' = 0.5 in, the extrude feature in the timeline simply lists 'Distance' as 0.25.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Surely I'm using the parameter wrong? Otherwise it seems like this is a decent bug/oversight in the API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kyle&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 17:55:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/user-parameter-in-extrude/m-p/9700406#M12643</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-19T17:55:20Z</dc:date>
    </item>
  </channel>
</rss>

