<?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 programmatically access resource array index in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553392#M57509</link>
    <description>&lt;P&gt;Just FYI, this will be much easier in FlexSim 2017 which will be out soon (the beta is available now). We've added dot syntax and a new Array type to FlexScript so accessing the 2nd resource would look like this:&lt;/P&gt;&lt;PRE&gt;token.myOperator[2]&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Dec 2016 20:31:33 GMT</pubDate>
    <dc:creator>Matthew_Gillespie</dc:creator>
    <dc:date>2016-12-01T20:31:33Z</dc:date>
    <item>
      <title>How to programmatically access resource array index</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553389#M57506</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 16.2.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;How do you access a specific resource index when an array has been created on the label that references all the acquired resource.&lt;/P&gt;
&lt;P&gt;To illustrate, this only changes the color of the object referenced in index 1 even if multiple resources are acquired....&lt;/P&gt;
&lt;P&gt;colorlime(getlabel(token, "myoperator"));&lt;/P&gt;
&lt;P&gt;Suppose I need to change the color of only the 2nd resource of 3 total acquired resources. How would that be accomplished?&lt;/P&gt;
&lt;P&gt;I studied the switch code in the Move Object activity's 'Object From Label Array', but I don't know how to apply it in this scenario.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 19:09:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553389#M57506</guid>
      <dc:creator>stan_e_davis</dc:creator>
      <dc:date>2016-12-01T19:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically access resource array index</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553390#M57507</link>
      <description>&lt;P&gt;In order to get a reference to specific ranks within your Array, I would set a label as a reference.   IN the picklist options for Assign Label Activity under the value field you can select Array &amp;gt; Value from Label Array.   This will let you set the index number you're trying to select of which label (In this case whatever label you set your Resource as.)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="4099-label-array.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1494631i77B35587CA88F1DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="4099-label-array.png" alt="4099-label-array.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then you can use the new label reference you created to alter the color or whatever logic you need.&lt;/P&gt;&lt;P&gt;I've included a simple example.&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.flexsim.com/storage/attachments/4100-color-example.fsm"&gt;color-example.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 19:28:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553390#M57507</guid>
      <dc:creator>sam_stubbsYXX86</dc:creator>
      <dc:date>2016-12-01T19:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically access resource array index</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553391#M57508</link>
      <description>&lt;P&gt;Sam,&lt;/P&gt;
&lt;P&gt;That will work for me! I need to remember that while the acquired activity's label is destroyed once all the resources are released, the array reference label persists although now empty. I appreciate the very quick reply.&lt;/P&gt;
&lt;P&gt;Stan&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 20:11:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553391#M57508</guid>
      <dc:creator>stan_e_davis</dc:creator>
      <dc:date>2016-12-01T20:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically access resource array index</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553392#M57509</link>
      <description>&lt;P&gt;Just FYI, this will be much easier in FlexSim 2017 which will be out soon (the beta is available now). We've added dot syntax and a new Array type to FlexScript so accessing the 2nd resource would look like this:&lt;/P&gt;&lt;PRE&gt;token.myOperator[2]&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Dec 2016 20:31:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553392#M57509</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2016-12-01T20:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically access resource array index</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553393#M57510</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html" nodeid="87"&gt;@Matthew Gillespie&lt;/A&gt; using dot syntax, how can you access all of the acquired resources (i.e. I want both cranes to travel,load item, travel, and unload)? Or is this not possible? This is what the token label looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="6116-cranearray.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1494632iEBDE2716C90E369C/image-size/large?v=v2&amp;amp;px=999" role="button" title="6116-cranearray.png" alt="6116-cranearray.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 16:08:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553393#M57510</guid>
      <dc:creator>kari_payton</dc:creator>
      <dc:date>2017-04-03T16:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically access resource array index</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553394#M57511</link>
      <description>&lt;P&gt;Note that in the same menu as in the screenshot, there is also a "Remove Bad References" option which will cut out all items in the array that are no longer pointing to a valid object.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 16:12:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553394#M57511</guid>
      <dc:creator>mischa_spelt</dc:creator>
      <dc:date>2017-04-03T16:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically access resource array index</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553395#M57512</link>
      <description>&lt;P&gt;You still need to access each one individually. I would suggest using a RunSubFlow activity to create a child token for each individual crane. See &lt;A href="https://answers.flexsim.com/questions/22481/process-flow-item-array-data-controlsprocess-flow.html"&gt;this post&lt;/A&gt; (especially Matt Long's model in the comments) for an example of this. For the quantity of child tokens to make you would use:&lt;/P&gt;&lt;PRE&gt;token.Crane.length&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Apr 2017 19:22:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553395#M57512</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2017-04-03T19:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to programmatically access resource array index</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553396#M57513</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html" nodeid="87"&gt;@Matthew Gillespie&lt;/A&gt; using subflow was what I attempted to do. However, the second crane isn't traveling or changing states. I made a &lt;A href="https://answers.flexsim.com/questions/37270/utilize-two-cranes-at-once.html"&gt;question here.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 21:01:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-programmatically-access-resource-array-index/m-p/13553396#M57513</guid>
      <dc:creator>kari_payton</dc:creator>
      <dc:date>2017-04-03T21:01:32Z</dc:date>
    </item>
  </channel>
</rss>

