<?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: How to call the user command having array as a parameter? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573050#M72861</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;The code is this:&lt;/P&gt;&lt;PRE&gt;Array theArray=param(1);
double minval=GLOBAL_UNREACHABLE;
for (int n=theArray.length;n&amp;gt;0;n--)
&amp;nbsp; &amp;nbsp; minval=Math.min(minval,theArray&lt;N&gt;);
return minval;&lt;/N&gt;&lt;/PRE&gt;&lt;P&gt;The command is setup like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1726136260020.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1525251iCF88896258FFA515/image-size/large?v=v2&amp;amp;px=999" role="button" title="1726136260020.png" alt="1726136260020.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I called it using this line in a script console:&lt;/P&gt;&lt;PRE&gt;minValInArray([5,8,33])&lt;/PRE&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 12 Sep 2024 10:18:14 GMT</pubDate>
    <dc:creator>jason_lightfoot_adsk</dc:creator>
    <dc:date>2024-09-12T10:18:14Z</dc:date>
    <item>
      <title>How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573044#M72855</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.2.1 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi Team,&lt;/P&gt;
 &lt;P&gt;I have created a user command and passing array as a parameter. But, it is showing errors while calling the user command.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1726063660777.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1525256iF8E277980F36BD52/image-size/large?v=v2&amp;amp;px=999" role="button" title="1726063660777.png" alt="1726063660777.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1726063984957.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1525257iD1B19DE7FB18C486/image-size/large?v=v2&amp;amp;px=999" role="button" title="1726063984957.png" alt="1726063984957.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Could you help me to know where it is going wrong?&lt;/P&gt;
 &lt;P&gt;Thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Sep 2024 14:15:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573044#M72855</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2024-09-11T14:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573045#M72856</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/24.2/Reference/Tools/UserCommands/UserCommands.html#parameters" target="_blank"&gt;Here's the documentation &lt;/A&gt;- you should use "var seq" in your list of parameters.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Sep 2024 14:37:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573045#M72856</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-09-11T14:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573046#M72857</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/226/jason.l.html" nodeid="226"&gt;@Jason Lightfoot&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;Thanks for providing the documentation link.&lt;/P&gt;
 &lt;P&gt;Before, I was using Array seq = param(1); while defining user command.&lt;/P&gt;
 &lt;P&gt;Now, I made the correction as below:&lt;/P&gt;
 &lt;P&gt;&lt;STRONG&gt;var seq = param(1);&lt;/STRONG&gt;&lt;/P&gt;
 &lt;P&gt;Even I am getting the same errors while calling the user command as&lt;/P&gt;
 &lt;P&gt;&lt;STRONG&gt;int Min_Time = Min_Changeover_Time([1,2,3]);&lt;/STRONG&gt;&lt;/P&gt;
 &lt;P&gt;It is not accepting array as a parameter.&lt;/P&gt;
 &lt;P&gt;Do I need to change anything else?&lt;/P&gt;
 &lt;P&gt;Thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Sep 2024 07:51:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573046#M72857</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2024-09-12T07:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573047#M72858</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="002.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1525250i12CE8C02BEF52C0D/image-size/large?v=v2&amp;amp;px=999" role="button" title="002.png" alt="002.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;try here&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Sep 2024 08:37:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573047#M72858</guid>
      <dc:creator>962076751</dc:creator>
      <dc:date>2024-09-12T08:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573048#M72859</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;The Array type is correct in the code but not in the parameter definition of the user command where you must use 'var' or Variant.&lt;/P&gt;&lt;P&gt;Example attached.&lt;/P&gt;&lt;P&gt; &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/86425-usercomand-minvalinarray.fsm" target="_blank"&gt;UserComand_minValInArray.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Sep 2024 09:24:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573048#M72859</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-09-12T09:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573049#M72860</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;A rel="user" href="https://answers.flexsim.com/users/226/jason.l.html" nodeid="226"&gt;@Jason Lightfoot&lt;/A&gt; 
 &lt;P&gt;I can't open it as it is in 2024 version.&lt;/P&gt;
 &lt;P&gt;Could you share it 2023 version?&lt;/P&gt;
 &lt;P&gt;Thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Sep 2024 10:01:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573049#M72860</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2024-09-12T10:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573050#M72861</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;The code is this:&lt;/P&gt;&lt;PRE&gt;Array theArray=param(1);
double minval=GLOBAL_UNREACHABLE;
for (int n=theArray.length;n&amp;gt;0;n--)
&amp;nbsp; &amp;nbsp; minval=Math.min(minval,theArray&lt;N&gt;);
return minval;&lt;/N&gt;&lt;/PRE&gt;&lt;P&gt;The command is setup like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1726136260020.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1525251iCF88896258FFA515/image-size/large?v=v2&amp;amp;px=999" role="button" title="1726136260020.png" alt="1726136260020.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I called it using this line in a script console:&lt;/P&gt;&lt;PRE&gt;minValInArray([5,8,33])&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Sep 2024 10:18:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573050#M72861</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2024-09-12T10:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573051#M72862</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;A rel="user" href="https://answers.flexsim.com/users/226/jason.l.html" nodeid="226"&gt;@Jason Lightfoot&lt;/A&gt; 
 &lt;P&gt;Thank you so much! It is working now.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Sep 2024 13:49:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573051#M72862</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2024-09-12T13:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573052#M72863</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/226/jason.l.html" nodeid="226"&gt;@Jason Lightfoot&lt;/A&gt; &lt;/P&gt;
 &lt;P&gt;I have one more question to ask for better clarity if I can.&lt;/P&gt;
 &lt;P&gt;For return type, we have used num as the return value is an integer. &lt;/P&gt;
 &lt;P&gt;But instead of 1, I would like to add 2 return values as an output. For example:- &lt;/P&gt;
 &lt;P&gt;&lt;STRONG&gt;Final Sequence Array&lt;/STRONG&gt; along with &lt;STRONG&gt;Min Changeover Time&lt;/STRONG&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1726213435946.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1525252i79A56C0E6BCC0A91/image-size/large?v=v2&amp;amp;px=999" role="button" title="1726213435946.png" alt="1726213435946.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1726213494624.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1525253iD9FAAC6D7B0D201B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1726213494624.png" alt="1726213494624.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;After defining the user command, that's how I was calling it:&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1726213629770.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1525254i3A656A52AA16F352/image-size/large?v=v2&amp;amp;px=999" role="button" title="1726213629770.png" alt="1726213629770.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Here is the output:&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1726213861413.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1525255i83E41C9ABF4A71AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="1726213861413.png" alt="1726213861413.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;It is not working correctly for &lt;STRONG&gt;min_Time &lt;/STRONG&gt;value as it should be 224. I feel it is just taking the first element of array as output for min_Time.&lt;/P&gt;
 &lt;P&gt;Any help would be appreciated.&lt;/P&gt;
 &lt;P&gt;Thanks!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Sep 2024 07:55:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573052#M72863</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2024-09-13T07:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573053#M72864</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;Code execution stops after the first "return". You have to return the values as an array.&lt;PRE&gt;return [bestOrder, minTime];&lt;/PRE&gt;Use "Variant" as the return type and assign the values as follows.&lt;PRE&gt;Array result = Get_Min_CO_Time(...).as(Array);
Array bestsequence = result[1];
double min_Time = result[2];&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Sep 2024 08:36:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573053#M72864</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2024-09-13T08:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to call the user command having array as a parameter?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573054#M72865</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Got it 
 &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; 
 &lt;P&gt;Working as expected. Thank you so much!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Sep 2024 11:04:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-call-the-user-command-having-array-as-a-parameter/m-p/13573054#M72865</guid>
      <dc:creator>rajankur6494</dc:creator>
      <dc:date>2024-09-13T11:04:40Z</dc:date>
    </item>
  </channel>
</rss>

