<?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 Slider Command Input Help (Command Inputs in General) in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/slider-command-input-help-command-inputs-in-general/m-p/5709809#M21033</link>
    <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;I'm new to Fusion's API and to Python in general, and I'm having a lot of trouble creating command inputs. Essentially, I have a basic sketch I want to make that's driven by certain dimensions passed in by the user when the script is run. I'm using the "Create Bolt" script as scaffolding, but I'm having trouble switching from input values (included in the Bolt script) to slider inputs. I've read the documentation on command inputs but, not being a native programmer, it yielded no help. Can anybody assist with some high-level conceptualization of what pieces of code need to be present to get slider inputs? (What are the CommandCreatedHandler, CommandExecuteHandler, CommandDestroyHandler, etc?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, here's the specific problem I'm having.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is the snippit within the CommandCreatedHandler that I'm attempting to use to get user input:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;            #define the inputs
            inputs = cmd.commandInputs
            inputs.addStringValueInput('boardName', 'Board Name', defaultBoardName)

            &lt;FONT color="#FF0000"&gt;inputs.addFloatSliderCommandInput('camber', 'Camber','in',.1,1)&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;The string value input ('Board Name') works fine, but the Float Slider throws errors. Specifically, it seems to be angry with the corresponding part of the CommandExecuteHandler:&lt;/P&gt;&lt;PRE&gt;class BoardCommandExecuteHandler(adsk.core.CommandEventHandler):
    def __init__(self):
        super().__init__()
    def notify(self, args):
        try:
            unitsMgr = app.activeProduct.unitsManager
            command = args.firingEvent.sender
            inputs = command.commandInputs

            board = Board()
            for input in inputs:
                if input.id == 'boardName':
                    board.boardName = input.value
&lt;FONT color="#FF0000"&gt;                elif input.id == 'camber':
                    board.camber = input.value&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;The text in red shows the part that's throwing the error. What's wrong with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance/explanation greatly appreciated. Thanks,&lt;/P&gt;&lt;P&gt;-Myles&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2015 23:13:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-07-07T23:13:19Z</dc:date>
    <item>
      <title>Slider Command Input Help (Command Inputs in General)</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/slider-command-input-help-command-inputs-in-general/m-p/5709809#M21033</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;I'm new to Fusion's API and to Python in general, and I'm having a lot of trouble creating command inputs. Essentially, I have a basic sketch I want to make that's driven by certain dimensions passed in by the user when the script is run. I'm using the "Create Bolt" script as scaffolding, but I'm having trouble switching from input values (included in the Bolt script) to slider inputs. I've read the documentation on command inputs but, not being a native programmer, it yielded no help. Can anybody assist with some high-level conceptualization of what pieces of code need to be present to get slider inputs? (What are the CommandCreatedHandler, CommandExecuteHandler, CommandDestroyHandler, etc?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, here's the specific problem I'm having.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is the snippit within the CommandCreatedHandler that I'm attempting to use to get user input:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;            #define the inputs
            inputs = cmd.commandInputs
            inputs.addStringValueInput('boardName', 'Board Name', defaultBoardName)

            &lt;FONT color="#FF0000"&gt;inputs.addFloatSliderCommandInput('camber', 'Camber','in',.1,1)&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;The string value input ('Board Name') works fine, but the Float Slider throws errors. Specifically, it seems to be angry with the corresponding part of the CommandExecuteHandler:&lt;/P&gt;&lt;PRE&gt;class BoardCommandExecuteHandler(adsk.core.CommandEventHandler):
    def __init__(self):
        super().__init__()
    def notify(self, args):
        try:
            unitsMgr = app.activeProduct.unitsManager
            command = args.firingEvent.sender
            inputs = command.commandInputs

            board = Board()
            for input in inputs:
                if input.id == 'boardName':
                    board.boardName = input.value
&lt;FONT color="#FF0000"&gt;                elif input.id == 'camber':
                    board.camber = input.value&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;The text in red shows the part that's throwing the error. What's wrong with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance/explanation greatly appreciated. Thanks,&lt;/P&gt;&lt;P&gt;-Myles&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 23:13:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/slider-command-input-help-command-inputs-in-general/m-p/5709809#M21033</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-07T23:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Slider Command Input Help (Command Inputs in General)</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/slider-command-input-help-command-inputs-in-general/m-p/5709914#M21034</link>
      <description>&lt;P&gt;Hi myles,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this part "&lt;FONT color="#ff0000"&gt;elif input.id == 'camber': board.camber = input.value&lt;/FONT&gt;", FloatSliderCommandInput doesn't have property "value" but "valueOne" and "valueTwo", because it can have two values. So calling of property "value" will throw exception. Please change the property to "valueOne" and try again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Zhijie&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2015 01:46:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/slider-command-input-help-command-inputs-in-general/m-p/5709914#M21034</guid>
      <dc:creator>zhijie.li</dc:creator>
      <dc:date>2015-07-08T01:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Slider Command Input Help (Command Inputs in General)</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/slider-command-input-help-command-inputs-in-general/m-p/5710813#M21035</link>
      <description>&lt;P&gt;Wow, quick response and it worked perfectly! Funny how 3 letters can keep me stumped for so long...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a ton!&lt;/P&gt;&lt;P&gt;-Myles&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2015 15:08:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/slider-command-input-help-command-inputs-in-general/m-p/5710813#M21035</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-08T15:08:08Z</dc:date>
    </item>
  </channel>
</rss>

