& Construction

Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
& Manufacturing

Professional CAD/CAM tools built on Inventor and AutoCAD
Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
Professional CAD/CAM tools built on Inventor and AutoCAD
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;
How to buy
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © 2025 Autodesk Inc. All rights reserved
Type a product name