question

Brendon N avatar image
0 Likes"
Brendon N asked chukiat commented

Delete Global Table using custom code

Is there a way you can delete an entire global table using a custom code block?

FlexSim 18.2.1
global tablecodecustom codedelete
· 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.

Raja Sekaran avatar image Raja Sekaran commented ·

@Brendon N

Have you tried using the destroy command to delete the node?

2 Likes 2 ·
Joerg Vogel avatar image Joerg Vogel Raja Sekaran commented ·
model().find("Tools/GlobalTables/GlobalTable1").destroy();
1 Like 1 ·
Brendon N avatar image Brendon N Raja Sekaran commented ·

@Raja Sekaran @Jörg Vogel Yes this worked, thank you very much!

0 Likes 0 ·
Brendon N avatar image
0 Likes"
Brendon N answered Brendon N edited

Thanks to @Raja Sekaran and @Jörg Vogel


model().find("Tools/GlobalTables/GlobalTable1").destroy();
5 |100000

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

chukiat avatar image
0 Likes"
chukiat answered chukiat commented

May I ask more by use this topic

If I just want to clear data in Globaltable to blank but still need to keep that table with no. of column and row

What code can I use for this


Thank you very much

· 2
5 |100000

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

Felix Möhlmann avatar image Felix Möhlmann commented ·

For the most part Table("tableName").clear() will be sufficient for this.

If the cells contain simple data type (arrays) or bundle data, some more code is necessary. You can just look at the code the "Clear All Cell Data" option in the global table reset trigger uses.

capture1.png

0 Likes 0 ·
capture1.png (30.3 KiB)
chukiat avatar image chukiat Felix Möhlmann commented ·

Hi Felix

I can use Table("tableName").clear()

Thank you very much

0 Likes 0 ·