Delete Global Table using custom code

Delete Global Table using custom code

brendon_n
Not applicable
226 Views
7 Replies
Message 1 of 8

Delete Global Table using custom code

brendon_n
Not applicable

[ FlexSim 18.2.1 ]

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

0 Likes
Accepted solutions (1)
227 Views
7 Replies
Replies (7)
Message 2 of 8

raja_sekaran
Not applicable

@Brendon N

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

Message 3 of 8

joerg_vogel_HsH
Mentor
Mentor
model().find("Tools/GlobalTables/GlobalTable1").destroy();
Message 4 of 8

brendon_n
Not applicable

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

0 Likes
Message 5 of 8

brendon_n
Not applicable
Accepted solution

Thanks to @Raja Sekaran and @Jörg Vogel


model().find("Tools/GlobalTables/GlobalTable1").destroy();
0 Likes
Message 6 of 8

Chukiat
Not applicable

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

0 Likes
Message 7 of 8

moehlmann_fe
Enthusiast
Enthusiast

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
Message 8 of 8

Chukiat
Not applicable

Hi Felix

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

Thank you very much

0 Likes