<?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: Set Item color and process items based on labels and item type in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/set-item-color-and-process-items-based-on-labels-and-item-type/m-p/13522308#M32881</link>
    <description>&lt;P&gt;I changed up your creation trigger so that it would assign Type and Subtype based off of operations done on a value "type" that allows you to set the color as well. so now your Types will be 1-3 and your Subtypes will be 1-3, I also changed up the flow so they would check for 1-3 rather than 4-6. You can change it back to checking for 4-6 if you want, just change the code&lt;/P&gt;
&lt;P&gt;item.Subtype=type%3+1;&lt;/P&gt;
&lt;P&gt;to &lt;/P&gt;
&lt;P&gt;item.Subtype=type%3+4;&lt;/P&gt;
&lt;P&gt;it was just easier for me to think of it using a 3X3 matrix&lt;/P&gt;
&lt;P&gt; &lt;A id="18353" href="https://answers.flexsim.com/storage/attachments/18353-18352-color-by-label-and-item-type.fsm"&gt;18352-color-by-label-and-item-type.fsm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;What you are doing for the processor should work, just change the "variant" to "Type".&lt;/P&gt;</description>
    <pubDate>Fri, 05 Apr 2019 21:18:23 GMT</pubDate>
    <dc:creator>joshua_s</dc:creator>
    <dc:date>2019-04-05T21:18:23Z</dc:date>
    <item>
      <title>Set Item color and process items based on labels and item type</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/set-item-color-and-process-items-based-on-labels-and-item-type/m-p/13522307#M32880</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.0.2 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Hello I am trying to create some logic for a bigger simulation i am trying to do.&lt;/P&gt;
&lt;P&gt;Requirements :&lt;/P&gt;
&lt;P&gt;1) I need to produce 9 different product types on my line&lt;/P&gt;
&lt;P&gt;2) I have 3 major product types , I have 3 sub product types under every major product.&lt;/P&gt;
&lt;P&gt;3) I use the Even trigger ( On creation to assign 3 different major product types )&lt;/P&gt;
&lt;P&gt;4) I use the assign label on creation to assign my sub products to the major types so 3X3 = 9&lt;/P&gt;
&lt;P&gt;5) I want to create the item colors based on both type and label , not successful&lt;/P&gt;
&lt;P&gt;6) I know i can just go ahead and create 9 different item types or labels but I want to use labels and item types so i can use labels later in the process to route the items to different locations in the conveyor.&lt;/P&gt;
&lt;P&gt;7) I have used the following expression on the set object color &lt;/P&gt;
&lt;P&gt;Color.byNumber(item.Type)+Color.byNumber(item.Subtype)&lt;/P&gt;
&lt;P&gt;Can some one tell me how to fix this ??&lt;/P&gt;
&lt;P&gt;&lt;A id="18350" href="https://answers.flexsim.com/storage/attachments/18350-set-object-color-expression.png"&gt;set-object-color-expression.png&lt;/A&gt;&lt;A id="18352" href="https://answers.flexsim.com/storage/attachments/18352-color-by-label-and-item-type.fsm"&gt;color-by-label-and-item-type.fsm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://answers.flexsim.com/storage/attachments/18350-set-object-color-expression.png"&gt;&lt;/A&gt;&lt;A id="18351" href="https://answers.flexsim.com/storage/attachments/18351-source-triggers.jpg"&gt;source-triggers.jpg&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Also I want to know if the expression i am using to process the 9 different items based on the labels on the same processor is right.&lt;A rel="nofollow" id="18349" href="https://answers.flexsim.com/storage/attachments/18349-processor-based-on-label-value.png"&gt;processor-based-on-label-value.png&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;1) I use the getlabelnum(item,"labelname") and I use the value by case for the processing time on the processors&lt;/P&gt;
&lt;P&gt;Is this the best way to do this or is there some other way where i can do it based on item type too ??&lt;/P&gt;
&lt;P&gt;I have attached my model for the set object color and i have attached screen shots for the other questions.&lt;/P&gt;
&lt;P&gt;Thanks &lt;/P&gt;
&lt;P&gt;Karthik&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 20:07:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/set-item-color-and-process-items-based-on-labels-and-item-type/m-p/13522307#M32880</guid>
      <dc:creator>karthikeyan_b</dc:creator>
      <dc:date>2019-04-05T20:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Set Item color and process items based on labels and item type</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/set-item-color-and-process-items-based-on-labels-and-item-type/m-p/13522308#M32881</link>
      <description>&lt;P&gt;I changed up your creation trigger so that it would assign Type and Subtype based off of operations done on a value "type" that allows you to set the color as well. so now your Types will be 1-3 and your Subtypes will be 1-3, I also changed up the flow so they would check for 1-3 rather than 4-6. You can change it back to checking for 4-6 if you want, just change the code&lt;/P&gt;
&lt;P&gt;item.Subtype=type%3+1;&lt;/P&gt;
&lt;P&gt;to &lt;/P&gt;
&lt;P&gt;item.Subtype=type%3+4;&lt;/P&gt;
&lt;P&gt;it was just easier for me to think of it using a 3X3 matrix&lt;/P&gt;
&lt;P&gt; &lt;A id="18353" href="https://answers.flexsim.com/storage/attachments/18353-18352-color-by-label-and-item-type.fsm"&gt;18352-color-by-label-and-item-type.fsm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;What you are doing for the processor should work, just change the "variant" to "Type".&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2019 21:18:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/set-item-color-and-process-items-based-on-labels-and-item-type/m-p/13522308#M32881</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2019-04-05T21:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Item color and process items based on labels and item type</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/set-item-color-and-process-items-based-on-labels-and-item-type/m-p/13522309#M32882</link>
      <description>&lt;P&gt;&lt;A id="18364" href="https://answers.flexsim.com/storage/attachments/18364-box-types.jpg"&gt;box-types.jpg&lt;/A&gt;&lt;A id="18365" href="https://answers.flexsim.com/storage/attachments/18365-source-trigger-code.jpg"&gt;source-trigger-code.jpg&lt;/A&gt;Hello Joshua Thank you for your response.&lt;/P&gt;
&lt;P&gt;I am still relatively a new user when it comes to custom coding but would love to understand the basics so I can take that and change it in my model as I go.&lt;/P&gt;
&lt;P&gt;I had some more questions.&lt;/P&gt;
&lt;P&gt;What does the % signify in this expression ?&lt;/P&gt;
&lt;P&gt;" item.Subtype=type%3+1 "&lt;/P&gt;
&lt;P&gt;I understand you have used a custom code to create item types based on D uniform distribution to assign labels 0 ~8 giving me 9 types but when i pull up my item properties I am getting decimal values in my item type , Please correct me if i am wrong but shouldn't these be real numbers ??&lt;/P&gt;
&lt;P&gt;item.Type=type/3+1 - So am I assigning the item type to be 0/4,1/4,2/4,3/4,4/4,5/4....8/4 = 0,0.25,0.5,0.75,1....2 ?&lt;/P&gt;
&lt;P&gt;Can you also clarify the significance of the code on what its doing so i can modify it based on my application ?&lt;/P&gt;
&lt;P&gt;Thanks and regards&lt;/P&gt;
&lt;P&gt;Karthik&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2019 12:51:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/set-item-color-and-process-items-based-on-labels-and-item-type/m-p/13522309#M32882</guid>
      <dc:creator>karthikeyan_b</dc:creator>
      <dc:date>2019-04-06T12:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set Item color and process items based on labels and item type</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/set-item-color-and-process-items-based-on-labels-and-item-type/m-p/13522310#M32883</link>
      <description>&lt;P&gt;Hello Joshua I think after looking at the logic and some searching i understand it.&lt;/P&gt;
&lt;P&gt;% - is the mod operator in C is that correct ?&lt;/P&gt;
&lt;P&gt;I see what you did here to define the types and sub types.&lt;/P&gt;
&lt;P&gt;Really smart way to do it. Thank you.&lt;/P&gt;
&lt;P&gt;But is there still a way to get only whole numbers instead of decimals and still achieve this ?&lt;/P&gt;
&lt;P&gt;Thanks and regards&lt;/P&gt;
&lt;P&gt;Karthik&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2019 14:36:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/set-item-color-and-process-items-based-on-labels-and-item-type/m-p/13522310#M32883</guid>
      <dc:creator>karthikeyan_b</dc:creator>
      <dc:date>2019-04-06T14:36:47Z</dc:date>
    </item>
  </channel>
</rss>

