question

wooram-kim avatar image
1 Like"
wooram-kim asked Gui Vaccaro commented

Getting a value from an option-type parameter

Hi,

I have found that I cannot access a value of option-type paramters with flexscript ("Model.parameters.Parameter1"). I have checked that flexscript with braket works well (Model.parameters["Parameter1"].value). I attached the file.

parameters.fsm

Thank you.

FlexSim 24.1.1
flexscriptparameters
parameters.fsm (24.9 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
1 Like"
Felix Möhlmann answered Gui Vaccaro commented

Interesting. While the documentation states that both expressions are identical in behaviour, this apparently isn't true for the option type parameter.

The syntax with square brackets returns the rank of the currently chosen option. Whereas "Model.parameters.Parameter1" returns the value assigned to the currently active option.

1739862262889.png


1739862262889.png (5.5 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.