Calling user commands in the GUI interface

Calling user commands in the GUI interface

wang_z2
Not applicable
759 Views
3 Replies
Message 1 of 4

Calling user commands in the GUI interface

wang_z2
Not applicable

[ FlexSim 18.2.2 ]

In my model ,I want to trigger the User command after pressing the button in GUI.

16768-pic.jpg

In pic,I also want to assign the input parameters to some of the parameters in the user command.

For example,I want input "90" in the first blank,and assign it to the "number"(row 5 in User command).

How can i achieve it?

Thanks a lotgui-to-user-command.fsm

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

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

You can add nodes at the user command that store number data. You use GUI edit fields to set node value, which you evaluate in the user command to resize or set the location of the rack.

Highlight the command node icon. Press return key. This inserts a node in the subtree. Rename the node for example to "myVar2".

16831-add-node-add-usercommand2.gif

Highlight the node icon of myVar2 Right Mouse Button to open the context: Choose Node > Add Number Data .

16832-node-add-number-data.jpg

Change the data to another value 3.4.

Reset the model.

source code to print the number data of the inserted nodes "myVar1" and "myVar2" ín the user command:

print(c.up.subnodes["myVar1"].value,"  ",c.up.subnodes["myVar2"].value);
0 Likes
Message 3 of 4

wang_z2
Not applicable

Thanks a lot !

It worked

0 Likes
Message 4 of 4

wang_z2
Not applicable

I have meet another problem

Now,I want trigger the User command to create racks,I verified the correctness of creating racks code in the script console.

And set the "start" control (pic1),but it doesn't work

16844-pic1.jpg

0 Likes