question

Noah Z avatar image
0 Likes"
Noah Z asked Noah Z commented

Move Global Table to different subfolder

I'd like to use flexscript to move a global table to another folder. For example, move GlobalTable2 from TestFolder to DestFolder. Is there a clean way to do this?


1718205289294.png

FlexSim 23.2.2
global tablesfolders
1718205289294.png (3.1 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

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Noah Z commented

You need to do this in a different part of the tree:

treenode ToolboxGTs=Model.find("Tools/Toolbox/GlobalTables");
ToolboxGTs.find("TestFolder/1").up=ToolboxGTs.find("DestFolder");
· 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.

Noah Z avatar image Noah Z commented ·

Awesome thanks! Follow-up question....If the global table isn't in a folder already how does the code change if I want to insert it into the DestFolder? I tried a few things but they are throwing errors


1718225779666.png


0 Likes 0 ·
1718225779666.png (3.8 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Noah Z commented ·
ToolboxGTs.find("DestFolder").subnodes.add().value=ownerobject(Table("GlobalTable1")); 
1 Like 1 ·
Noah Z avatar image Noah Z Jason Lightfoot ♦♦ commented ·
Thanks!
0 Likes 0 ·