The location information of object in differnt plane.

The location information of object in differnt plane.

s1125413
Advocate Advocate
447 Views
6 Replies
Message 1 of 7

The location information of object in differnt plane.

s1125413
Advocate
Advocate

Hello FlexSim community and @FelixMoehlmann ,

 

The object’s coordinates are not recorded using the same standard when it is placed on different planes.

Is there any method to make the object’s coordinates on Plane 1/Plane1 consistent with those on Plane1?

Thank you in advance for your help.

s1125413_0-1766061986508.png

 

 

 

 

 

 

0 Likes
Accepted solutions (2)
448 Views
6 Replies
Replies (6)
Message 2 of 7

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

Use getLocation() to get the location as a Vec3 variable. (I would always prefer this over using the location property because it allows you to find the coordinates of a specific point of the object, most often the center.) Then use project() to convert the coordinates. Either into the coordinate system of the other queue's parent object or convert both to a shared system, like the model itself.

0 Likes
Message 3 of 7

s1125413
Advocate
Advocate

Thank you so much, it working!!

0 Likes
Message 4 of 7

s1125413
Advocate
Advocate

Hello @FelixMoehlmann ,Sorry to bother you on an old post.

I followed your advice to use getlocation() to keep the object within the model() coordinate system across different planes.

However, as shown in the picture, the two objects in the plane still do not match the coordinates of /Queue1. Do you have any suggestions?

 

Thank you in advance!

 

 

 

 

0 Likes
Message 5 of 7

FelixMoehlmann
Collaborator
Collaborator

"getLocation()" by itself just gets the coordinates within the parent object. You then also need to project the coordinates.

Screenshot 2026-05-08 112313.png

0 Likes
Message 6 of 7

s1125413
Advocate
Advocate

@FelixMoehlmann it read the coordinate that what I need!! But I want to set location to update the Object's coordinate based the Table, is there any method instead to the location.x an y? 

s1125413_0-1778245909856.png

 

0 Likes
Message 7 of 7

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

Write the coordiantes to a Vec3 variable. Project that to the correct coordinate space. Then set the location.

Vec3 loc = Vec3(Table(...)[row][col], Table(...)[row][col], 0);
a.setLocation(loc, Vec3(0.5, 0.5, 0));

https://docs.flexsim.com/en/26.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Vec3.html 

0 Likes