Adding "Groups" and "Global Variables" to a User Library

Adding "Groups" and "Global Variables" to a User Library

cytsengi
Observer Observer
50 Views
1 Reply
Message 1 of 2

Adding "Groups" and "Global Variables" to a User Library

cytsengi
Observer
Observer

I am creating a user library, and I have added some Global Tables to  the library as Auto-Install Component. However, I'd like to know if it's possible to similarly auto-install "Groups" and "Global Variables" when the library is imported. What are the available options for including these elements as Auto-Install Components?

 

Thanks.

 

FlexSim version: 24.1.1

0 Likes
51 Views
1 Reply
Reply (1)
Message 2 of 2

joerg_vogel_HsH
Mentor
Mentor

I didn't find a button to add a group directly as a user library item. You will have to build a group by code like this from tools API class :

treenode group = Tools.create("Group");
group.name = "newGroup2";

The same method applies for global variables, too.

treenode variable = Tools.create("GlobalVariable");

You will have to add this code to nodes like newmodelinstall. 

In this post you find an example how to get this done.

You find source code like this if you explore the view tree of toolbox by right mouse button menu under item view. Container node is menupopup. Each node string data starting with "button... contains source code that you can try to use it. Often is a source code line starting with applicationcomand responsible for opening a windows associated with this tool.   

0 Likes