<?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: Distance checker in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/distance-checker/m-p/13594471#M89600</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/42938/omer0.html" nodeid="42938"&gt;@omer0&lt;/A&gt;,&lt;/P&gt;
 &lt;P&gt;You can do this by using the Vec3 class, which you can read about here: &lt;A href="https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Vec3.html" target="test_blank"&gt;https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Vec3.html&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;Here is some code that you can copy into your script window. When you run this script, it will give you the distance between Processor1 and Processor2. &lt;/P&gt;
 &lt;PRE&gt;&lt;STRONG&gt;Object obj1 = Model.find("Processor1");
Object obj2 = Model.find("Processor2");

Vec3 centres=Vec3(0.5,0.5,0.5); // set up centre factors for the axes
Vec3 locDiff=obj1.getLocation(centres).project(obj1.up,model())-obj2.getLocation(centres).project(obj2.up,model()); &amp;nbsp; // projecting onto the model in case they are in different containers/coordinate systems
double distance=locDiff.magnitude;
return distance;&lt;/STRONG&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;/DIV&gt;</description>
    <pubDate>Wed, 05 Jul 2023 19:06:21 GMT</pubDate>
    <dc:creator>natalie_white</dc:creator>
    <dc:date>2023-07-05T19:06:21Z</dc:date>
    <item>
      <title>Distance checker</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/distance-checker/m-p/13594470#M89599</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;Hello How can I check for the distance between multiple processors in general?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Jul 2023 18:03:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/distance-checker/m-p/13594470#M89599</guid>
      <dc:creator>omer0</dc:creator>
      <dc:date>2023-07-05T18:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Distance checker</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/distance-checker/m-p/13594471#M89600</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/42938/omer0.html" nodeid="42938"&gt;@omer0&lt;/A&gt;,&lt;/P&gt;
 &lt;P&gt;You can do this by using the Vec3 class, which you can read about here: &lt;A href="https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Vec3.html" target="test_blank"&gt;https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Vec3.html&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;Here is some code that you can copy into your script window. When you run this script, it will give you the distance between Processor1 and Processor2. &lt;/P&gt;
 &lt;PRE&gt;&lt;STRONG&gt;Object obj1 = Model.find("Processor1");
Object obj2 = Model.find("Processor2");

Vec3 centres=Vec3(0.5,0.5,0.5); // set up centre factors for the axes
Vec3 locDiff=obj1.getLocation(centres).project(obj1.up,model())-obj2.getLocation(centres).project(obj2.up,model()); &amp;nbsp; // projecting onto the model in case they are in different containers/coordinate systems
double distance=locDiff.magnitude;
return distance;&lt;/STRONG&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Jul 2023 19:06:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/distance-checker/m-p/13594471#M89600</guid>
      <dc:creator>natalie_white</dc:creator>
      <dc:date>2023-07-05T19:06:21Z</dc:date>
    </item>
  </channel>
</rss>

