question

Stan Davis avatar image
0 Likes"
Stan Davis asked Stan Davis commented

Send Message - String Parameter Issue

I am trying to pass a string value referencing a location in the 3D model as one of the Send Message parameters to be assigned to a label in a wait for message event:..

1630523307025.png

However, this results in a "Invalid cast from char* to double" error.


I've tried using a number reference:

1630522929809.png


This results with token.destination value of...

1630522999324.png


But this results as a 'invalid destination' when used in a Move Object activity.

So how does one pass a valid location reference to be stored in a token label???

Thanks


FlexSim 21.1.5
processflowparametersflexsim 21.1.5send message
1630522929809.png (1.9 KiB)
1630522999324.png (1.4 KiB)
1630523307025.png (101.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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Stan Davis commented

The predefined "Send Message" option only allows double values because the "senddelayedmessage" command only supports numbers as message parameters. "sendmessage" can handle other variable types as well.

Either open the code window of the option and change the double parameters to "Variant" manually (in that case make sure that the delay time is always set to -1).

1630524288977.png

Opening the pick option GUI again will overwrite this though, so it might be better so simply write a code snippet with the "sendmessage" command yourself. You can find information on the syntax of commands under "Help -> Command Helper".

sendmessage(toObject, fromObject, param1, param2, param3)  // the params are optional

1630524288977.png (34.2 KiB)
· 1
5 |100000

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

Stan Davis avatar image Stan Davis commented ·
Understood. Thanks again Felix.
0 Likes 0 ·