<?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 change label of flowitem as it exits a processor in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498224#M13939</link>
    <description>&lt;P&gt;thank you sir&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2018 08:59:47 GMT</pubDate>
    <dc:creator>arindam_mahata</dc:creator>
    <dc:date>2018-02-21T08:59:47Z</dc:date>
    <item>
      <title>how to change label of flowitem as it exits a processor</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498222#M13937</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.0.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;we can use setlabel on exit trigger but my problem is not about changing labels of all the flowitems exiting.suppose there are two items having label say "A" with values 1 and 2 and i want to change the value of item having "A" value=1 to 3.plz help&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 06:03:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498222#M13937</guid>
      <dc:creator>arindam_mahata</dc:creator>
      <dc:date>2018-02-21T06:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to change label of flowitem as it exits a processor</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498223#M13938</link>
      <description>&lt;P&gt;If you use the standard "Set Label" trigger option, and click the little 'Code' button to its right, the code-behind for that option will open and show you a line such as &lt;/P&gt;&lt;PRE&gt;involved.labels.assert(labelname).value = value;&lt;/PRE&gt;&lt;P&gt;which does the actual setting of the label.&lt;/P&gt;&lt;P&gt;You can change this to something like&lt;/P&gt;&lt;PRE&gt;if(involved.labels.assert(labelname).value == 1) {
  involved.labels.assert(labelname).value == value;
}&lt;/PRE&gt;&lt;P&gt;where the additional &lt;EM&gt;if&lt;/EM&gt; clause will check if the current value is equal to 1 or not.&lt;/P&gt;&lt;P&gt;Or you can replace the whole code by something simpeler&lt;/P&gt;&lt;PRE&gt;Object item = param(1);
Object current = ownerobject(c);
int port = param(2);


if(item.LabelOnItem? == 1) {
	item.LabelOnItem = 3;
}
&lt;/PRE&gt;&lt;P&gt;but then you will not be able to modify it from the popup anymore.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 08:13:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498223#M13938</guid>
      <dc:creator>mischa_spelt</dc:creator>
      <dc:date>2018-02-21T08:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to change label of flowitem as it exits a processor</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498224#M13939</link>
      <description>&lt;P&gt;thank you sir&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 08:59:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498224#M13939</guid>
      <dc:creator>arindam_mahata</dc:creator>
      <dc:date>2018-02-21T08:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to change label of flowitem as it exits a processor</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498225#M13940</link>
      <description>&lt;P&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/469/mischa.s.html" nodeid="469"&gt;@Mischa Spelt&lt;/A&gt; ,&lt;/P&gt;
&lt;P&gt;I tried to use your code to change just one label of one product as asked in the question at the top. So I wrote the code below but nothing happened with my flowitem. The Labelname of my first item stayed at 1 after processing. &lt;/P&gt;
&lt;P&gt;I also used your second code : Label name doesn't change.&lt;/P&gt;
&lt;P&gt;Have you another solution to suggest ?&lt;/P&gt;
&lt;P&gt;Thanks for your response&lt;/P&gt;
&lt;PRE&gt;if(involved.labels.assert(labelname).value == 1) {
  involved.labels.assert(labelname).value == 3;
}&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jun 2018 09:20:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498225#M13940</guid>
      <dc:creator>francois_g</dc:creator>
      <dc:date>2018-06-08T09:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to change label of flowitem as it exits a processor</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498226#M13941</link>
      <description>&lt;P&gt;Hi Françios. In the second line, you have a comparison instead of an assignment. Replace the == by an =.&lt;/P&gt;&lt;P&gt;Actually you don't need to assert the label twice: when you get into the if it will definitely exist so you can just write it as&lt;/P&gt;&lt;PRE&gt;if(involved.labels.assert(labelname).value == 1) {
  involved.labels[labelname].value = 3;
}&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jun 2018 09:57:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-change-label-of-flowitem-as-it-exits-a-processor/m-p/13498226#M13941</guid>
      <dc:creator>mischa_spelt</dc:creator>
      <dc:date>2018-06-08T09:57:09Z</dc:date>
    </item>
  </channel>
</rss>

