question

Manuel Sinco avatar image
1 Like"
Manuel Sinco asked Enrique Elizaga commented

How to close a Global Table with code?

Hello, I want to close a Global Table that is open like using the X button, this is based on that I'm using the command: applicationcommand("addglobaltable") and when the Global Table is created, it also pops up and I don't want that, so if I can change the command's behavior or I can use code to just close the Table.

Thanks.

FlexSim 19.1.0
global tabledeveloper use
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

·
Matthew Gillespie avatar image
5 Likes"
Matthew Gillespie answered Enrique Elizaga commented

If you don't want the table to open when you create it you should pass 1 as the second parameter

applicationcommand("addglobaltable", 1) 
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Manuel Sinco avatar image Manuel Sinco commented ·

Great! Thanks Matt, it worked exactly as I wanted. Thank you.

0 Likes 0 ·
Manuel Sinco avatar image Manuel Sinco commented ·
@Matthew Gillespie

If I want to just close it with code what is the command to do it? For example, the table is already created and I opened it, but now by using code I want to close it.

Thanks.

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Manuel Sinco commented ·
treenode globalTable = Model.find("Tools/GlobalTables/GlobalTable2");
treenode tableViews = node("VIEW:/active>Documents/Table");

for (int i = 1 ; i <= tableViews.subnodes.length; i++) {
	treenode tableView = ownerobject(tableViews.subnodes[i].value);
	treenode focus = objectfocus(tableView).value;
	if (focus == globalTable) {
		applicationcommand("closedockedtab", tableView);
		break;
	}
}
2 Likes 2 ·
Manuel Sinco avatar image Manuel Sinco Matthew Gillespie ♦♦ commented ·

Thanks it worked properly.

0 Likes 0 ·
Enrique Elizaga avatar image Enrique Elizaga commented ·

Awesome, this is what I was looking for.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.