<?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 How to calculate the distance between 2 Objects in a conveyor? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508255#M21892</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.2.3 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the distance between two object in the conveyor, I planned to used the normal distances formula, however it's only for straight paths, if I have any curved conveyors it won't work.&lt;/P&gt;
&lt;P&gt;I'm attaching a image to give an example.&lt;/P&gt;
&lt;P&gt;I appreciate your help thanks.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="17518-distance.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1498686iDF99BD3A87D2F9BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="17518-distance.png" alt="17518-distance.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Feb 2019 19:33:43 GMT</pubDate>
    <dc:creator>manuel_s4</dc:creator>
    <dc:date>2019-02-22T19:33:43Z</dc:date>
    <item>
      <title>How to calculate the distance between 2 Objects in a conveyor?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508255#M21892</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.2.3 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I want to calculate the distance between two object in the conveyor, I planned to used the normal distances formula, however it's only for straight paths, if I have any curved conveyors it won't work.&lt;/P&gt;
&lt;P&gt;I'm attaching a image to give an example.&lt;/P&gt;
&lt;P&gt;I appreciate your help thanks.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="17518-distance.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1498686iDF99BD3A87D2F9BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="17518-distance.png" alt="17518-distance.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 19:33:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508255#M21892</guid>
      <dc:creator>manuel_s4</dc:creator>
      <dc:date>2019-02-22T19:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the distance between 2 Objects in a conveyor?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508256#M21893</link>
      <description>&lt;P&gt;For the item on the Conveyor, you can select it and find out how far along on the Conveyor it is in the quick properties, then for each conveyor you can find out its length by opening a script window and use this code&lt;/P&gt;
&lt;PRE&gt;model.find("Conveyor").as(Conveyor).length&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Feb 2019 19:57:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508256#M21893</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2019-02-22T19:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the distance between 2 Objects in a conveyor?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508257#M21894</link>
      <description>&lt;P&gt;I know about the quick properties and understand what you are saying, but I have a lot of DP in my conveyor I want to develop a code that can tell me that automatically de distance between them. &lt;/P&gt;
&lt;P&gt;That works only with 1 conveyor, so I need to know how many conveyors are joint together. For example in the photo that I'm showing I have 4 connected conveyors so it'll be, only for this case:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;double Distance = model.find("Conveyor1").as(Conveyor).length + model.find("Conveyor2").as(Conveyor).length + model.find("Conveyor3").as(Conveyor).length + model.find("Conveyor4").as(Conveyor).length;&lt;/P&gt;
&lt;P&gt;And then I need to know where DP 1 &amp;amp; 2 are and then take way that distance.&lt;BR /&gt;&lt;BR /&gt;I want something that when I indicate where are those DP I would knoe the distance in the conveyor between them, independently of where they are. &lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 20:13:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508257#M21894</guid>
      <dc:creator>manuel_s4</dc:creator>
      <dc:date>2019-02-22T20:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the distance between 2 Objects in a conveyor?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508258#M21895</link>
      <description>&lt;P&gt;See if this code works for you. For setup, create a group named "ConveyorSystem1", then add the conveyors to the group in path/input order. I added a sample model to demonstrate this.&lt;/P&gt;
&lt;PRE&gt;Object DP1=Model.find("DP1");//First Decision Point, must be behind the second Decision Point
Object DP2=Model.find("DP2");//Second Decision Point, must be ahead of the first Decision Point
Object CDP1=ownerobject(getvarnode(DP1, "conveyorPoint").subnodes[1].value);
Object CDP2=ownerobject(getvarnode(DP2, "conveyorPoint").subnodes[1].value);
double Dist=0;
for (int i=1;i&amp;lt;=getvarnode(CDP1, "conveyorPoints").subnodes.length;i++)
{
	if (ownerobject(getvarnode(CDP1, "conveyorPoints").subnodes&lt;I&gt;.value)==DP1)
	{
		Dist+=getvarnum(CDP1, "length")-getvarnode(CDP1, "conveyorPoints").subnodes&lt;I&gt;.subnodes[1].value;
	}
}


for (int i=1;i&amp;lt;=getvarnode(CDP2, "conveyorPoints").subnodes.length;i++)
{
	if (ownerobject(getvarnode(CDP2, "conveyorPoints").subnodes&lt;I&gt;.value)==DP2)
	{
		Dist+=getvarnode(CDP2, "conveyorPoints").subnodes&lt;I&gt;.subnodes[1].value;
	}
}
for (int i=Group("ConveyorSystem1").indexOf(CDP1)+1;i &amp;lt; Group("ConveyorSystem1").indexOf(CDP2);i++ )
{
	Dist+=getvarnum(Group("ConveyorSystem1")&lt;I&gt;, "length");
}
return Dist;
&lt;BR /&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A id="17522" href="https://answers.flexsim.com/storage/temp/17522-dist-on-conveyor.fsm"&gt;dist-on-conveyor.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 21:29:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508258#M21895</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2019-02-22T21:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the distance between 2 Objects in a conveyor?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508259#M21896</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt; Other way to calculate that, using the decision point is the property of Conveyor Class:&lt;/P&gt;
&lt;P&gt; Conveyor.estimateConveyTime() &lt;/P&gt;
&lt;P&gt;Arguments: estimateConveyTime( Object origin , double n_a , Object dest , double n_a , double itemLength , int flags = 0 )&lt;/P&gt;
&lt;P&gt; this property return the time between two decision point, using default speed &lt;/P&gt;
&lt;P&gt;Distance= Conveyor.defaultSpeed * Conveyor.estimateConveyTime( D1, 0 , D2, 1,0) &lt;/P&gt;
&lt;P&gt;Where &lt;/P&gt;
&lt;P&gt; D1: Decision poitn 1 &lt;/P&gt;
&lt;P&gt;D2: Decision poitn 2 &lt;/P&gt;
&lt;P&gt;Item leght: use 1 &lt;/P&gt;
&lt;P&gt; The manual says use "0" for " n_a" &lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 15:41:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508259#M21896</guid>
      <dc:creator>jsserranoa</dc:creator>
      <dc:date>2019-06-18T15:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the distance between 2 Objects in a conveyor?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508260#M21897</link>
      <description>&lt;P&gt;Funcionó exactamente cómo estaba buscando, muchas gracias &lt;A rel="user" href="https://answers.flexsim.com/users/8097/javier-santiagosa.html" nodeid="8097"&gt;@Santiago Serrano&lt;/A&gt;. Saludos!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 22:16:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508260#M21897</guid>
      <dc:creator>manuel_s4</dc:creator>
      <dc:date>2020-02-18T22:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the distance between 2 Objects in a conveyor?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508261#M21898</link>
      <description>&lt;P&gt;Que bueno&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 15:31:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-calculate-the-distance-between-2-objects-in-a-conveyor/m-p/13508261#M21898</guid>
      <dc:creator>jsserranoa</dc:creator>
      <dc:date>2020-02-19T15:31:47Z</dc:date>
    </item>
  </channel>
</rss>

