Hello How can I check for the distance between multiple processors in general?
Hello How can I check for the distance between multiple processors in general?
Hi @omer0,
You can do this by using the Vec3 class, which you can read about here: https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Vec3.html
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.
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()); // projecting onto the model in case they are in different containers/coordinate systems double distance=locDiff.magnitude; return distance;
13 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved