question

Unax Urrutia avatar image
0 Likes"
Unax Urrutia asked Unax Urrutia commented

Change size by label

Hello!

I already read some answers about the topic but I doesn't work in my model.

I want to change the size of the items according to labels. For this, I used a GlobalTable with X,Y,Z in the rows and the labels in the columns and then attach it to the trigger. With this it occurs an error.

I attach my model to you to see it. Is in the source called "PB_TrenLogistikoa".


EIKA_Osoa.fsm

FlexSim 23.2.3
labelitem size
eika-osoa.fsm (192.4 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

Oriol Font avatar image
3 Likes"
Oriol Font answered Unax Urrutia commented

The problem is that the label Type is a number so it's trying to access the column with that index, if Type = 600 it's trying to access the 600th column. In order to make it work try using:
Table("GlobalTable1")[1][item.Type.as(string)]
As it will covert Type to a string when accessing the table as the column headers are als strings.

· 2
5 |100000

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

Nil Ns avatar image Nil Ns commented ·

Apart from that, I think that the percentages in the "Set Label by Percentage" are not equal to 100. This causes the label to sometimes be created without a value, generating an error.

2 Likes 2 ·
Unax Urrutia avatar image Unax Urrutia commented ·

Thanks a lot. Problem solved

0 Likes 0 ·