question

Axel Kohonen avatar image
0 Likes"
Axel Kohonen asked Axel Kohonen commented

Setting a table into bundle mode with FlexScript

Hi,

Is it possible to set a table to use bundle mode with FlexScript? I create the tables at model reset and for the larger ones I would like to set them into bundle mode. I have so many tables that doing it manually takes way too long.

If the option above is not possible then another option is to create the table by copying a table and then copying the variables node from a table that is in bundle mode, but I would like to avoid that if possible as then I need to have an extra table in the model just for copying.

Thank you!

Kind regards,

Axel

FlexSim 17.2.5
custom codetablesbundle
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

Phil BoBo avatar image
2 Likes"
Phil BoBo answered Axel Kohonen commented

After creating the table, the following script will change its data from regular to bundle:

  1. treenode data = Table("GlobalTable1");
  2. treenode newData = nodeinsertafter(data);
  3. setname(newData, getname(data));
  4. nodeadddata(newData, DATATYPE_BUNDLE);
  5. data.as(Table).cloneTo(newData.as(Table));
  6. destroyobject(data);
· 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.