As shown in below image, In Global table one cell is assigned as Bundle data. And writing to that cell, but not able to achieve as bundle data
How to create bundle data in global table any feedback on this. I am attaching model where I am trying.
As shown in below image, In Global table one cell is assigned as Bundle data. And writing to that cell, but not able to achieve as bundle data
How to create bundle data in global table any feedback on this. I am attaching model where I am trying.
@Sudheer Reddy, are you wanting the entire Global Table, GlobalTable1, to be a bundle table? Or are you trying to store a bundle table in cell (1,1) of GlobalTable1 - a table within a table?
If it's the first option, then you'll want to check the box called "Use Bundle" in the Quick Properties for GlobalTable1. Then, you can use the "Write to a Global Table" option in the Custom Code activity in Process Flow. That option will write to a Global Table if that table is a Tree table (the non bundle type of table) or a bundle table, it makes no difference.
If it's the second option, then you just need to treat cell (1,1) as a table itself, but there isn't really a dropdown option that does this for you. So you will need to do something like this in the Code Editor, or by choosing the Code Snippet dropdown option, either way in the Custom Code activity:
Table(Table("GlobalTable1").cell(1, 1))[1][1] = Model.time;
Or you can also do something like this:
addbundleentry(Table("GlobalTable1").cell(1, 1), Model.time);
Doing it this way, you'll probably want to add a bundle field to the cell first. You can do this by double clicking on the cell to open the bundle in a Table view, then you can add columns for every field that you want in the bundle. If it's just the one value (Model.time) that you want to add to the bundle, then one field will be sufficient.
If you're trying to do something different with bundles, and these two options do not answer your question, please give us some more information about what you want to accomplish using bundles.
@Logan Gold Thanks for your answer.
Table(Table("GlobalTable1").cell(1, 1))[1][1] = Model.time;
For above code when I tried following is the error I got
addbundleentry(Table("GlobalTable1").cell(1, 1), Model.time);
For the above code the following error I am getting
And When I tried with entire Global table as bundle data following error I am getting
addbundlefield(..) prepare a new column
addbundleentry(..) prepare and set initial values
or
setbundlevalue(obj node, num row base 0, list of values)
like in a table which is not a global table
Table myTable = [treenode reference] myTable[1][1] = [value of datatype in column]
Sorry, but I forgot to mention that if you use the method using this code (as in bundleData.fsm):
Table(Table("GlobalTable1").cell(1, 1))[1][1] = Model.time;
You will have first needed to add enough entries to the bundle. So you need at least one entry/row already added if you are trying to change row 1 of the bundle. If you were to continue trying to change [2][1], [3][1], etc., then you'll need to make sure there are enough entries already added to the bundle before changing the data in those entries. Think of it like a Global Table, where you need enough rows and columns in the table before you can change the values of the table cells.
For simplicity, you could just use the other option using addbundleentry() (like with bundledata-1.fsm). This will automatically add the entry for you, then automatically set the data in that entry according to the second parameter. And just like Jorg mentioned, you will need to add a field to your bundle before adding entries in either case. Just doubleclick on the cell in GlobalTable1 to open the bundle in a Table view, then use the Quick Properties of that bundle table to add columns. The columns in the table view are the same as bundle fields, where the field name will be the text in the column headers. If you only want Model.time in each row/entry, then one column/field is sufficient. More data per entry will require adding more fields.
If you change the entire Global Table to a bundle (like with bundledata-2.fsm), don't use the Table().cell() command. Just add your data like any other Global Table. You can either use the "Write to a Global Table" dropdown option or something like:
Table("GlobalTable1")[1][1] = Model.time;
Here again, make sure there are enough rows already added to the table before trying to change the values in a specific row.
12 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved