question

Gagandeep S2 avatar image
0 Likes"
Gagandeep S2 asked Felix Möhlmann answered

How to find global co-ordinate of a slot in a floor storage system.

My model is always returning the position of the bottom left corner of the floor storage rather than the slot.

FlexSim 21.1.4
floor storage
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Felix Möhlmann avatar image
2 Likes"
Felix Möhlmann answered
Vec3 globalLoc1 = token.slot.as(Storage.Slot).storageObject.location;

This is the same as writing

Object Rack = token.slot.as(Storage.Slot).storageObject;
Vec3 globalLoc1 = Rack.location;

and returns the location of the storage object the slot is in. To get the position of the slot use the "getLocation()" method on the slot itself. Note that this will return the coordinates in the reference frame of the storage object, so you have to project from there to the model to get the global coordinates.
(You can write it all in one line, but because the slot reference is needed twice this would be rather lengthy, so I opted to create a "slot" variable.)

Storage.Slot slot = token.slot;
Vec3 globalLoc1 = slot.getLocation(0.5, 0.5, 0.5).project(slot.storageObject, model());
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.