<?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 edit packing method ro rotate object in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557617#M60865</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;By using "Edit packing method " in flow item bin you can create new packing method or change exsidted packing method by writing the code on " custom code".&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="35305-1608118937877.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504524i2E62FC6439B8C9AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="35305-1608118937877.png" alt="35305-1608118937877.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then you also have to change the packing method at palleta in flow item bin.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="35323-1608119311401.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504527i696911BD20A49340/image-size/large?v=v2&amp;amp;px=999" role="button" title="35323-1608119311401.png" alt="35323-1608119311401.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 16 Dec 2020 11:51:03 GMT</pubDate>
    <dc:creator>patryk_u2</dc:creator>
    <dc:date>2020-12-16T11:51:03Z</dc:date>
    <item>
      <title>How to edit packing method ro rotate object</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557616#M60864</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 20.2.3 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;How to edit the packing method to achive this result?&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/35313-pz-packing.fsm" target="_blank"&gt;pz-packing.fsm&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;36 pcs per Layer and 16 Layers up -&amp;gt; 576 items on 1 "pallet"&lt;/P&gt;
 &lt;P&gt;How to rotate propare item and set a space between 2nd and 3rd row?&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="35322-1608114567282.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504541iA0AB9D534F048F7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="35322-1608114567282.png" alt="35322-1608114567282.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="35303-1608114196024.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504542i60C46DE7FD5CAD85/image-size/large?v=v2&amp;amp;px=999" role="button" title="35303-1608114196024.png" alt="35303-1608114196024.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Dec 2020 10:30:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557616#M60864</guid>
      <dc:creator>ukasz_e</dc:creator>
      <dc:date>2020-12-16T10:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit packing method ro rotate object</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557617#M60865</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;By using "Edit packing method " in flow item bin you can create new packing method or change exsidted packing method by writing the code on " custom code".&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="35305-1608118937877.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504524i2E62FC6439B8C9AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="35305-1608118937877.png" alt="35305-1608118937877.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then you also have to change the packing method at palleta in flow item bin.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="35323-1608119311401.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504527i696911BD20A49340/image-size/large?v=v2&amp;amp;px=999" role="button" title="35323-1608119311401.png" alt="35323-1608119311401.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Dec 2020 11:51:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557617#M60865</guid>
      <dc:creator>patryk_u2</dc:creator>
      <dc:date>2020-12-16T11:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit packing method ro rotate object</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557618#M60866</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;But how to rotate by 180 degrees the 1st and 3rd row and make the space between 2nd and 3rd row?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Dec 2020 12:06:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557618#M60866</guid>
      <dc:creator>ukasz_e</dc:creator>
      <dc:date>2020-12-16T12:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit packing method ro rotate object</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557619#M60867</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You can try use this code.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="35332-1608123057080.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504531iE21B3238C51063EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="35332-1608123057080.png" alt="35332-1608123057080.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="35308-1608123105478.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504532iDDF682CC9DD7A312/image-size/large?v=v2&amp;amp;px=999" role="button" title="35308-1608123105478.png" alt="35308-1608123105478.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In attached I send you the model.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/temp/35333-element.skp" target="_blank"&gt;element.skp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/temp/35319-packing-method.fsm" target="_blank"&gt;Packing method.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Dec 2020 12:54:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557619#M60867</guid>
      <dc:creator>patryk_u2</dc:creator>
      <dc:date>2020-12-16T12:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit packing method ro rotate object</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557620#M60868</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Great! Thank you so much, I change some locations for myself and how to flip the space? Because for me the space is between rows (and now is between columns), and z dimension. Next Layers go 0.1 to much "up". where to change those things?&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Object item = i;&lt;BR /&gt;Object current = c;&lt;BR /&gt;Object lastitem = item.prev;&lt;BR /&gt;/**Default Packing Method*/&lt;BR /&gt;&lt;BR /&gt;// Check to see if the flowitem is the first one in&lt;BR /&gt;if (current.subnodes.length == 1) {
  &lt;BR /&gt; item.setLocation(0.05, -0.1, current.size.z);&lt;BR /&gt; item.setRotation(0,0,180);&lt;BR /&gt; return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;//First row&lt;BR /&gt;double xlength = 0;&lt;BR /&gt;double ynumer = 0;&lt;BR /&gt;double xnumer = 0;&lt;BR /&gt;double znumer = 1;&lt;BR /&gt;int space =0;&lt;BR /&gt;for (int i = 1; i &amp;lt;= current.subnodes.length; i++) {
  &lt;BR /&gt; xlength = xlength+item.size.x;&lt;BR /&gt; if(xlength&amp;lt;=current.size.x){
  &lt;BR /&gt; space = ynumer/2;&lt;BR /&gt; if(ynumer==0&amp;amp;&amp;amp;xnumer==0&amp;amp;&amp;amp; znumer==1){
  &lt;BR /&gt; xnumer++;&lt;BR /&gt; }&lt;BR /&gt; xnumer++;&lt;BR /&gt; item.setLocation(xlength-item.size.x+0.1, -ynumer*item.size.y-space*0.2-0.1, current.size.z*znumer);&lt;BR /&gt; item.setRotation(0,0,180-180*Math.fmod(xnumer,2));&lt;BR /&gt; } else {
  &lt;BR /&gt; ynumer =ynumer+1;&lt;BR /&gt; if(ynumer&amp;lt;4){
  &lt;BR /&gt; xlength =item.size.x;&lt;BR /&gt; xnumer= 0+ Math.fmod(ynumer,2);&lt;BR /&gt; space = ynumer/2;&lt;BR /&gt; item.setLocation(xlength-item.size.x+0.05, -ynumer*item.size.y-space*0.2-0.1, current.size.z*znumer);&lt;BR /&gt; item.setRotation(0,0,180-180*Math.fmod(xnumer,2));&lt;BR /&gt; }else {
  &lt;BR /&gt; ynumer = 0;&lt;BR /&gt; znumer ++;&lt;BR /&gt; xlength =item.size.x;&lt;BR /&gt; xnumer= 0+ Math.fmod(ynumer,2);&lt;BR /&gt; space = ynumer/2;&lt;BR /&gt; double xnumer = 0;//pierwszy na górnej warstwie&lt;BR /&gt; item.setLocation(xlength-item.size.x+0.05, -ynumer*item.size.y-space*0.2-0.1, current.size.z*znumer-0.1);&lt;BR /&gt; item.setRotation(0,0,180);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="35328-1608126347898.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504534iDA1D094CEEBBEA4B/image-size/large?v=v2&amp;amp;px=999" role="button" title="35328-1608126347898.png" alt="35328-1608126347898.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Dec 2020 13:45:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557620#M60868</guid>
      <dc:creator>ukasz_e</dc:creator>
      <dc:date>2020-12-16T13:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit packing method ro rotate object</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557621#M60869</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You need to change the formula the"Space" and the place where it is included in the pattern.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="35342-1608132912188.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1504536i98591A5D14829FFF/image-size/large?v=v2&amp;amp;px=999" role="button" title="35342-1608132912188.png" alt="35342-1608132912188.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In attached I also send you the secound version of the mode.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/temp/35361-packing-method-v2.fsm" target="_blank"&gt;Packing method V2.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Dec 2020 15:36:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557621#M60869</guid>
      <dc:creator>patryk_u2</dc:creator>
      <dc:date>2020-12-16T15:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit packing method ro rotate object</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557622#M60870</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thank you very much! great code.&lt;/P&gt;
 &lt;P&gt;One more question - how to change the Z.&lt;/P&gt;
 &lt;P&gt;Because first layer goes perfectly on a pallet (pallet is 0.13 on Z) and item is 0.03. but the second Layer goes on 0.26 on Z, but it should 0.16. and the third goes on 0.39, so it also adds 0.13 but it shuld be 0.19&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Dec 2020 09:20:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557622#M60870</guid>
      <dc:creator>ukasz_e</dc:creator>
      <dc:date>2020-12-17T09:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit packing method ro rotate object</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557623#M60871</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You can try a change in every "item.setLocation" &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt; "current.size.z*znumer" to "current.size.z+item.size.z*(znumer-1)"&lt;/P&gt;&lt;P&gt;In this way, you set "z" location of the first layer as pallet hight and the next layers as pallet hight plus items hight. &lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Dec 2020 09:28:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557623#M60871</guid>
      <dc:creator>patryk_u2</dc:creator>
      <dc:date>2020-12-17T09:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit packing method ro rotate object</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557624#M60872</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thank you!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Dec 2020 10:03:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-edit-packing-method-ro-rotate-object/m-p/13557624#M60872</guid>
      <dc:creator>ukasz_e</dc:creator>
      <dc:date>2020-12-17T10:03:32Z</dc:date>
    </item>
  </channel>
</rss>

