<?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 Set Slot Value Using Variable Label Name in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555498#M59163</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;Thank you, &lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html" nodeid="87"&gt;@Matthew Gillespie&lt;/A&gt; ,&lt;P&gt;then we need methods to update slot labels for rack cells and a single slot. Or we need a method to update this special management, if a label is changed on a treenode level.&lt;/P&gt;&lt;P&gt;As discussed earlier indexing labels is only relevant, if slot label values have a static character. Then there must be existing a property to dealing with this attribute. &lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 03 Sep 2022 10:57:11 GMT</pubDate>
    <dc:creator>joerg_vogel_HsH</dc:creator>
    <dc:date>2022-09-03T10:57:11Z</dc:date>
    <item>
      <title>How To Set Slot Value Using Variable Label Name</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555492#M59157</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 22.2.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Looking for correct syntax to set label value using a variable in place of the label name.&lt;/P&gt;
 &lt;P&gt;For example..&lt;/P&gt;
 &lt;PRE&gt;string mylabelname;
mylabelname = "Apples";&lt;/PRE&gt;
 &lt;P&gt;This obviously does not work as it creates a label called "mylabelname"...&lt;/P&gt;
 &lt;PRE&gt;slot.mylabelname = 5;&lt;/PRE&gt;
 &lt;P&gt;Per help, should not access label nodes directly like this..&lt;/P&gt;
 &lt;PRE&gt;slot.labels.assert(mylabelname).value = 5;&lt;/PRE&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;So how do I do this?&lt;/P&gt;
 &lt;P&gt;Thanks&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Aug 2022 22:01:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555492#M59157</guid>
      <dc:creator>stan_e_davis</dc:creator>
      <dc:date>2022-08-23T22:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: How To Set Slot Value Using Variable Label Name</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555493#M59158</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;PRE&gt;slot.labels.assert(mylabelname,5).value = 4;&lt;/PRE&gt;&lt;P&gt;5 is an initial value, if label does not exist. If it exists the label gets assigned value 4. Obviously both values would be equal, but to describe it, I have chosen different values.&lt;/P&gt;&lt;P&gt;If a label is indexed, then it means, that it gets a static character. Indexed nodes get faster evaluated, but any change results in a new indexing and this take some time because all slots are checked if this label exists. &lt;BR /&gt;You would use an indexed label for racks that represent static data like city, country, plant. Labels, which values might change while a model runs, you wouldn’t  set an attribute to be indexed. &lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Aug 2022 22:46:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555493#M59158</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2022-08-23T22:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: How To Set Slot Value Using Variable Label Name</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555494#M59159</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;To clarify, you recommend using the assert method?&lt;/P&gt;
 &lt;P&gt;In Storage.Slot.labelProperties help section, it states..&lt;/P&gt;
 &lt;P style="border: 0px solid rgb(229, 231, 235); box-sizing: border-box; --tw-border-spacing-x:0; --tw-border-spacing-y:0; --tw-translate-x:0; --tw-translate-y:0; --tw-rotate:0; --tw-skew-x:0; --tw-skew-y:0; --tw-scale-x:1; --tw-scale-y:1; --tw-pan-x: ; --tw-pan-y: ; --tw-pinch-zoom: ; --tw-scroll-snap-strictness:proximity; --tw-ordinal: ; --tw-slashed-zero: ; --tw-numeric-figure: ; --tw-numeric-spacing: ; --tw-numeric-fraction: ; --tw-ring-inset: ; --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(59,130,246,0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000; --tw-shadow:0 0 #0000; --tw-shadow-colored:0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; margin: 0px 0px 25px; color: rgb(0, 0, 0); font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "&gt;&lt;SPAN style="color: rgb(44, 130, 201);"&gt;For slot labels, you MUST access the label through this dynamic properties syntax. You should not use syntax that accesses label nodes directly in the tree (like&lt;/SPAN&gt;&lt;/P&gt;
 &lt;PRE style="border: 0px solid rgb(229, 231, 235); box-sizing: border-box; --tw-border-spacing-x:0; --tw-border-spacing-y:0; --tw-translate-x:0; --tw-translate-y:0; --tw-rotate:0; --tw-skew-x:0; --tw-skew-y:0; --tw-scale-x:1; --tw-scale-y:1; --tw-pan-x: ; --tw-pan-y: ; --tw-pinch-zoom: ; --tw-scroll-snap-strictness:proximity; --tw-ordinal: ; --tw-slashed-zero: ; --tw-numeric-figure: ; --tw-numeric-spacing: ; --tw-numeric-fraction: ; --tw-ring-inset: ; --tw-ring-offset-width:0px; --tw-ring-offset-color:#fff; --tw-ring-color:rgba(59,130,246,0.5); --tw-ring-offset-shadow:0 0 #0000; --tw-ring-shadow:0 0 #0000; --tw-shadow:0 0 #0000; --tw-shadow-colored:0 0 #0000; --tw-blur: ; --tw-brightness: ; --tw-contrast: ; --tw-grayscale: ; --tw-hue-rotate: ; --tw-invert: ; --tw-saturate: ; --tw-sepia: ; --tw-drop-shadow: ; --tw-backdrop-blur: ; --tw-backdrop-brightness: ; --tw-backdrop-contrast: ; --tw-backdrop-grayscale: ; --tw-backdrop-hue-rotate: ; --tw-backdrop-invert: ; --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "&gt;&lt;SPAN style="color: rgb(44, 130, 201);"&gt;slot.labels.assert("SKU").value = 5;&lt;/SPAN&gt;&lt;/PRE&gt;
 &lt;P&gt;&lt;SPAN style="color: rgb(44, 130, 201);"&gt;&lt;SPAN style="font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "&gt;). The storage system may manage an index of slot label values for quick lookup. This index is only updated properly when you use the dynamic property syntax to set label values.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;If I understand your response, if I am NOT changing the values during the sim run, then using the assert method is not an issue. Is the index updated if I apply values using this method on a model reset trigger?&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 Aug 2022 17:20:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555494#M59159</guid>
      <dc:creator>stan_e_davis</dc:creator>
      <dc:date>2022-08-24T17:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: How To Set Slot Value Using Variable Label Name</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555495#M59160</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Could you give us a little more detail/context on what you're doing? If you have a use case that we don't have good support for we might need to look into improving the slot API.&lt;/P&gt;&lt;P&gt;If you happen to be setting the label on all the slots in the object/bay/level you can use one of the versions of the setSlotLabels() method that lets you pass in the name of the label:&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/22.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Warehousing/Storage.Object.html#Method-setSlotLabels" target="_blank"&gt;Storage.Object.setSlotLabels()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/22.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Warehousing/Storage.Bay.html#Method-setSlotLabels" target="_blank"&gt;Stoage.Bay.setSlotLabels()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/22.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Warehousing/Storage.Level.html#Method-setSlotLabels" target="_blank"&gt;Storage.Level.setSlotLabels()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Otherwise, it's a little tricky to use, buy you could try the executestring command. You dynamically create the FlexScript you want to run as a string and then call executestring() on it.&lt;/P&gt;&lt;PRE&gt;string myLabelName = "Apples";
string code = "Model.find(\"Rack1\").as(Storage.Object).getSlot(1, 1, 1).as(Storage.Slot).labelName = 5;";
executestring(code.replace("labelName", myLabelName));&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 31 Aug 2022 18:35:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555495#M59160</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2022-08-31T18:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: How To Set Slot Value Using Variable Label Name</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555496#M59161</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&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; , I think you can set a label value even by setting a node value. Then you would use a subnode reference to get the node and assign a value to him.&lt;/P&gt;&lt;PRE&gt;&lt;S&gt;slot.labels.subnode[myLabelName].value = 5; &lt;/S&gt;
slot.as(treenode).labels[myLabelName].value = 5;&lt;/PRE&gt;&lt;P&gt;maybe even shorter&lt;/P&gt;&lt;PRE&gt;&lt;S&gt;slot.labels[myLabelName].value = 5;&lt;/S&gt;&lt;/PRE&gt;&lt;P&gt;I’ll test it later in the day.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="slotlabel-by-string-variable-read-write.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1512419i080E2D2D8A2FF049/image-size/large?v=v2&amp;amp;px=999" role="button" title="slotlabel-by-string-variable-read-write.jpg" alt="slotlabel-by-string-variable-read-write.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 01 Sep 2022 06:05:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555496#M59161</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2022-09-01T06:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: How To Set Slot Value Using Variable Label Name</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555497#M59162</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/461/joerg.v.html" nodeid="461"&gt;@Joerg Vogel&lt;/A&gt; &lt;/P&gt;This partially works, but the help manual warns you not to do this since the Storage.Slot class does some extra managing of labels when you set a label on it that doesn't happen if you set the label using the treenode class.&lt;/DIV&gt;</description>
      <pubDate>Thu, 01 Sep 2022 20:45:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555497#M59162</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2022-09-01T20:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: How To Set Slot Value Using Variable Label Name</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555498#M59163</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;Thank you, &lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html" nodeid="87"&gt;@Matthew Gillespie&lt;/A&gt; ,&lt;P&gt;then we need methods to update slot labels for rack cells and a single slot. Or we need a method to update this special management, if a label is changed on a treenode level.&lt;/P&gt;&lt;P&gt;As discussed earlier indexing labels is only relevant, if slot label values have a static character. Then there must be existing a property to dealing with this attribute. &lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 03 Sep 2022 10:57:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555498#M59163</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2022-09-03T10:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: How To Set Slot Value Using Variable Label Name</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555499#M59164</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/626/stan.d.html" nodeid="626"&gt;@Stan Davis&lt;/A&gt;, was one of Matthew Gillespie's or Joerg Vogel's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 10 Sep 2022 14:14:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-set-slot-value-using-variable-label-name/m-p/13555499#M59164</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2022-09-10T14:14:53Z</dc:date>
    </item>
  </channel>
</rss>

