<?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: Script Help For User Entry Dialog Box in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/script-help-for-user-entry-dialog-box/m-p/8454897#M14947</link>
    <description>&lt;P&gt;I assume you've created a command and are creating ValueCommandInput objects in the command create.&amp;nbsp; When the command is executed, you can get the&amp;nbsp;information from the ValueCommandInput objects.&amp;nbsp; &amp;nbsp;It has a "value" property that will return the value of whatever the user entered in internal units (which is always centimeters).&amp;nbsp; This way the user works in whatever units they want (which defaults to the document units) but Fusion handles any conversion needed and will always return centimeters.&amp;nbsp; The ValueCommandInput object also has an "expression" property, which is the string that the user entered.&amp;nbsp; For example, if the document units are inches and they enter 1 into the input box, then the expression property will return "1" and the value property will return 2.54.&amp;nbsp; They could also enter something like "2/1" or "3 mm + 5 in" or "Length / 2".&amp;nbsp; For the last one, it's referring to an existing parameter.&amp;nbsp; The "expression" property will return the string the user entered.&amp;nbsp; The value will return the evaluated result, in centimeters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you draw the sketch&amp;nbsp;you use the value you get using the "value" property to draw the geometry because the values are always expected in centimeters.&amp;nbsp; When you create something that results in the creation of a parameter, like the extent of the extrusion, the input if a ValueInput object.&amp;nbsp; You can use either the createByReal or createByString methods to create a ValueInput object.&amp;nbsp; If you input a ValueInput object that contains a real value then the API will treat is as internal units (centimeters).&amp;nbsp; If you input a ValueInput object that contains a string, then it will use that as the expression for the created parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This was probably a much longer and more complicated answer than you were looking for, but hopefully it helps.&lt;/P&gt;</description>
    <pubDate>Sat, 08 Dec 2018 22:38:35 GMT</pubDate>
    <dc:creator>BrianEkins</dc:creator>
    <dc:date>2018-12-08T22:38:35Z</dc:date>
    <item>
      <title>Script Help For User Entry Dialog Box</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/script-help-for-user-entry-dialog-box/m-p/8454612#M14946</link>
      <description>&lt;P&gt;I am very new to programming and i have tried to struggle through teaching myself how to do this but i have come to the conclusion that i will not be able to do this without some assistance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My father purchased a CNC router that he will use to scribe/engrave wood and Plexiglas, the issue is he has zero knowledge on how to use CAD. so i would like to be able to create a script to automate as much as possible for him.&lt;/P&gt;
&lt;P&gt;What i am trying to do is make a dialog box that he can enter in a length width and height in inches and select a image to have placed on the top surface. from this it will create a rectangle extrusion with the image on the top surface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been able to create a script to extrude a rectangle and a script to create a dialog box with boxes for numerical values to be entered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i am struggling with how to relate what is entered in the box to the dimensions in the sketch and extrude feature.&lt;/P&gt;
&lt;P&gt;I have not even attempted to try and create the script to add the image to the top surface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The image will be simplified line art that he will use for the engravings. this might be something as simple as someones name or a sports team emblem.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Dec 2018 17:29:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/script-help-for-user-entry-dialog-box/m-p/8454612#M14946</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-08T17:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help For User Entry Dialog Box</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/script-help-for-user-entry-dialog-box/m-p/8454897#M14947</link>
      <description>&lt;P&gt;I assume you've created a command and are creating ValueCommandInput objects in the command create.&amp;nbsp; When the command is executed, you can get the&amp;nbsp;information from the ValueCommandInput objects.&amp;nbsp; &amp;nbsp;It has a "value" property that will return the value of whatever the user entered in internal units (which is always centimeters).&amp;nbsp; This way the user works in whatever units they want (which defaults to the document units) but Fusion handles any conversion needed and will always return centimeters.&amp;nbsp; The ValueCommandInput object also has an "expression" property, which is the string that the user entered.&amp;nbsp; For example, if the document units are inches and they enter 1 into the input box, then the expression property will return "1" and the value property will return 2.54.&amp;nbsp; They could also enter something like "2/1" or "3 mm + 5 in" or "Length / 2".&amp;nbsp; For the last one, it's referring to an existing parameter.&amp;nbsp; The "expression" property will return the string the user entered.&amp;nbsp; The value will return the evaluated result, in centimeters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you draw the sketch&amp;nbsp;you use the value you get using the "value" property to draw the geometry because the values are always expected in centimeters.&amp;nbsp; When you create something that results in the creation of a parameter, like the extent of the extrusion, the input if a ValueInput object.&amp;nbsp; You can use either the createByReal or createByString methods to create a ValueInput object.&amp;nbsp; If you input a ValueInput object that contains a real value then the API will treat is as internal units (centimeters).&amp;nbsp; If you input a ValueInput object that contains a string, then it will use that as the expression for the created parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This was probably a much longer and more complicated answer than you were looking for, but hopefully it helps.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Dec 2018 22:38:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/script-help-for-user-entry-dialog-box/m-p/8454897#M14947</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2018-12-08T22:38:35Z</dc:date>
    </item>
  </channel>
</rss>

