question

joey avatar image
0 Likes"
joey asked joey commented

Set the item location

Hello everyone. I want to set the location of 2 items within a single queue. Based on Global Table (use location X, Y, Z in the location setting).

Condition

Item 1 uses the Global Table (Type Table1) in the location settings.

Item 2 uses the Global Table (Type2 Table) in the location settings.

In which the model I attached. I have set the location of item 1 in queue 1 - queue 4 based on Global Table (Type Table1) and I want to add the location setting of item 2 to the queue 1,2,3,4.

Can this logic actually be created?

Thanks for the help.

set-location.fsm

FlexSim 19.0.1
queueset location
set-location.fsm (56.7 KiB)
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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered joey commented

I changed the SetLocation pickoption on the queues to be a code snippet using the following code:

string tableName = "Type Table" + string.fromNum(item.Type);
Table table = Table(tableName);
int row = current.count;
item.setLocation(table[row][2], table[row][3], table[row][4], 0.5, 0.5, 0);

It uses the item's type to make a string of the table's name. See the attached model.

setlocation.fsm


setlocation.fsm (56.2 KiB)
· 3
5 |100000

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

joey avatar image joey commented ·

Hi @Matthew Gillespie

I must thank you very much for your help in solving this problem.

But please describe the code you created What is this part?

Thank you.

0 Likes 0 ·
11.png (679 B)
Matthew Gillespie avatar image Matthew Gillespie ♦♦ joey commented ·

Those last three numbers are saying what point on the object to use as the object's position. In this case the center of the object on the bottom (50% of the X size, 50% of the Y size, and 0% of the Z).

See the documentation for the setLocation command:

https://docs.flexsim.com/en/19.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Tree/Object.html#Method-setLocation

This page about position reference might help explain it too:

https://docs.flexsim.com/en/19.1/Using3DObjects/WorkingWith3DObjects/MovingResizingRotating/#reference

0 Likes 0 ·
joey avatar image joey Matthew Gillespie ♦♦ commented ·

Thank you very much.

0 Likes 0 ·