<?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: Problem with moveobject() command in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580234#M78442</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;The default placement logic of a queue will&lt;/P&gt;&lt;P&gt;- not take into account the rotation of the item&lt;BR /&gt;- place the item outside its area, if it doesn't fit into the queue (with some padding space and again without taking rotation into account)&lt;/P&gt;&lt;P&gt;For both cases, the solution is to deactivate the queue's stacking behaviour and instead adjust the location to what it should be in the On Entry trigger with &lt;EM&gt;object.setLocation()&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="capture1.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520318i00CA3265B7229DBA/image-size/large?v=v2&amp;amp;px=999" role="button" title="capture1.png" alt="capture1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 02 Oct 2023 08:47:18 GMT</pubDate>
    <dc:creator>moehlmann_fe</dc:creator>
    <dc:date>2023-10-02T08:47:18Z</dc:date>
    <item>
      <title>Problem with moveobject() command</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580233#M78441</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.1.3 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi folks,&lt;/P&gt;
 &lt;P&gt;I'm having a bit of a problem when using the moveobject() command to move a flow item onto a queue. I have a list of flow items and would like to place them into their respective locations (queues). However, when I use the moveobject() command, the item is not placed onto the surface of its corresponding queue but it looks like the following photo&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1696234428108.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520322iD0E5299ADDD104BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="1696234428108.png" alt="1696234428108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;And it even looks weirder when I tried to move the item to the queues on the upper level, the item will have a large offset with the queue surface, like in this photo&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1696234604743.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520323i2834CAE970E7B628/image-size/large?v=v2&amp;amp;px=999" role="button" title="1696234604743.png" alt="1696234604743.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;Is there any way I can fix this? Thanks a lot for your help.&lt;/P&gt;
 &lt;P&gt;Here's the code I used to make this:&lt;/P&gt;
 &lt;PRE&gt;Table Init = Table("coil_file"); //list of items need to be generated
int nrow = Init.numRows;
treenode coil = Model.find("/Tools/FlowItemBin/Cylinder/1");
for (int index = 1; index &amp;lt;= nrow; index++)
{
&lt;SPAN style="white-space: normal;"&gt;&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;string location = Init[index]["location"]; //location where the item is placed&lt;/SPAN&gt;
&lt;SPAN style="white-space: normal;"&gt;&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;string coil_num = Init[index]["coil_number"];&lt;/SPAN&gt;
&lt;SPAN style="white-space: normal;"&gt;&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;int width = Init[index]["width"]; //dimension of the item from the list&lt;/SPAN&gt;
&lt;SPAN style="white-space: normal;"&gt;&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;int diameter = Init[index]["diameter"];&lt;/SPAN&gt;
&lt;SPAN style="white-space: normal;"&gt;&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Object newitem = coil.copy(model(), 0);&lt;/SPAN&gt;
&lt;SPAN style="white-space: normal;"&gt;&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;newitem.labels.assert("Coil_number").value = coil_num;&lt;/SPAN&gt;
&lt;SPAN style="white-space: normal;"&gt;&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;newitem.setSize(diameter/1000,diameter/1000,width/1000); //set item's dimensions&lt;/SPAN&gt;
&lt;SPAN style="white-space: normal;"&gt;&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Object dest = Model.find(location);&lt;/SPAN&gt;
&amp;nbsp;&lt;SPAN style="white-space:pre;"&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;moveobject(newitem, dest);
}&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Oct 2023 08:24:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580233#M78441</guid>
      <dc:creator>hoang_nk</dc:creator>
      <dc:date>2023-10-02T08:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with moveobject() command</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580234#M78442</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;The default placement logic of a queue will&lt;/P&gt;&lt;P&gt;- not take into account the rotation of the item&lt;BR /&gt;- place the item outside its area, if it doesn't fit into the queue (with some padding space and again without taking rotation into account)&lt;/P&gt;&lt;P&gt;For both cases, the solution is to deactivate the queue's stacking behaviour and instead adjust the location to what it should be in the On Entry trigger with &lt;EM&gt;object.setLocation()&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="capture1.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520318i00CA3265B7229DBA/image-size/large?v=v2&amp;amp;px=999" role="button" title="capture1.png" alt="capture1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Oct 2023 08:47:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580234#M78442</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-10-02T08:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with moveobject() command</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580235#M78443</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;hi, I set the On Entry trigger in the queue as you said but it placed the item further out, is this correct?&lt;/P&gt;
 &lt;PRE&gt;Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
Vec3 location = current.getLocation(0.5,0.5,0);
item.setLocation(location.x,location.y,location.z,0.5,0.5,0);&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Oct 2023 09:05:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580235#M78443</guid>
      <dc:creator>hoang_nk</dc:creator>
      <dc:date>2023-10-02T09:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with moveobject() command</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580236#M78444</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;The location is relative to the object's own coordinates, so the centre position of any object is:&lt;/P&gt;&lt;PRE&gt;Vec3 selfCentre=current.size/2;&lt;/PRE&gt;&lt;P&gt;You can then to choose alter z to be 0 (stack inside) or leave it (stack in middle) or do something else.&lt;/P&gt;&lt;P&gt;then use&lt;/P&gt;&lt;PRE&gt;Vec3 itemFactors=Vec3(0.5,0.5,0);
item.setlocation(selfCentre,itemFactors);&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Oct 2023 10:21:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580236#M78444</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-10-02T10:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with moveobject() command</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580237#M78445</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;And the &lt;EM&gt;itemFactors&lt;/EM&gt; vector is going to differ if the object is rotated around the x- or y-axis. (values below if rotated around one axis only)&lt;/P&gt;&lt;PRE&gt;Vec3 itemFactors = Vec3(0.5, 1, 0.5)   // xRot = 90;
Vec3 itemFactors = Vec3(0.5, 0, 0.5) &amp;nbsp; // xRot = -90;
Vec3 itemFactors = Vec3(1, 0.5, 0.5) &amp;nbsp; // yRot = 90;
Vec3 itemFactors = Vec3(0, 0.5, 0.5)   // yRot = -90;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Oct 2023 10:44:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580237#M78445</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-10-02T10:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with moveobject() command</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580238#M78446</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thank you it works for me now :)
&lt;/DIV&gt;</description>
      <pubDate>Tue, 03 Oct 2023 08:08:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/problem-with-moveobject-command/m-p/13580238#M78446</guid>
      <dc:creator>hoang_nk</dc:creator>
      <dc:date>2023-10-03T08:08:36Z</dc:date>
    </item>
  </channel>
</rss>

