Send Message - String Parameter Issue

Send Message - String Parameter Issue

stan.e.davis
Advocate Advocate
45 Views
2 Replies
Message 1 of 3

Send Message - String Parameter Issue

stan.e.davis
Advocate
Advocate

[ FlexSim 21.1.5 ]

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


0 Likes
Accepted solutions (1)
46 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Observer
Observer
Accepted solution

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
0 Likes
Message 3 of 3

stan.e.davis
Advocate
Advocate
Understood. Thanks again Felix.
0 Likes