question

Arun Kr avatar image
0 Likes"
Arun Kr asked Arun Kr commented

Empty GUI can't be Created Using Tools Method

On checking the Tools method, we can't create an empty GUI using Tools dot syntax API.

treenode GUI = Tools.create("GUI");

Any reason for this?

Regards,

Arun KR

FlexSim 23.2.0
gui
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Same for Global Macros too - although that's just a case of asserting a subnode into Tools.

Model.find("Tools").subnodes.assert("fsmacros","");
0 Likes 0 ·

1 Answer

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Arun Kr commented

The Tools.create() method was added to help users who want to autobuild parts of their model. The GUI builder tool was a tool that we thought users wouldn't (and probably shouldn't) autobuild.

· 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.

Arun Kr avatar image Arun Kr commented ·

I'm trying to build a global table that will be added to the user library with a custom GUI view. When I drag-drop the global table from the library, the GUI needs to be added to the tools section. In order to model this, during the custom global table drag-drop. I will create an empty GUI using the application command and then copy the saved custom GUI in the attribute node of the global table to the empty GUI. That's the reason I felt the need for Tool. create() method to create an empty GUI instead of using the application command.


0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Arun Kr commented ·

Since you already have your GUI defined you just need to copy it into the tools folder. You shouldn't need to create a new one.

myGUI.copy(Model.find("Tools").subnodes.assert("GUIs"));
0 Likes 0 ·
Arun Kr avatar image Arun Kr Matthew Gillespie ♦♦ commented ·
Thanks. This is good.
0 Likes 0 ·