question

Karan avatar image
0 Likes"
Karan asked Felix Möhlmann edited

Find slot query with address as alphanumeric token label

Hi,

I am trying to find a slot using the exact address that has been assigned to token.items[n].location

1690935642098.png

1690935727599.pngTested this in the script console and it works i.e. it finds a slot
1690935517310.png

However, I am unsure how to use the token label reference in the find slot activity

1690935754191.png


I believe the problem might be because the label is not stored as a string for some reason. So possible solutions based on my observation:

  1. How can I store a label as a string when using assign labels and getting value from a global table lookup?
  2. How can I use convert the $1.location into a string for the query to work?

Or if my understanding of the problem is incorrect, please help find a slot based on a specified address on a token. I tried the Get a Storage Slot by Address from assign labels but when I try to move objects into the slot, they instead use the rack's slot assignment strategy.

FlexSim 23.1.3
rackfind slot query
1690935517310.png (18.9 KiB)
1690935642098.png (26.5 KiB)
1690935727599.png (47.6 KiB)
1690935754191.png (46.1 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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann edited

The name of the label is the problem. location is a property of a Variant (which the $1 value is) that returns the coordinates of an object (if the Variant is an object) or throws an error (if it is not an object).

You can either change the name of the label or specifically tell FlexSim that 'location' is the name of a label in this case.

$1.labels["location"].value

Tip: An easy way to prevent issues like this is to start label names with a capital letter.

5 |100000

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