I am trying to display the label value as a string.
Please tell me how to convert an array which has pointers and arrays as elements to string .
I am trying to display the label value as a string.
Please tell me how to convert an array which has pointers and arrays as elements to string .
Let me add details to my previous question.
I want to output nodes whose contents are Array or Bundle as if they were viewed on a tree display screen.
I would like to store them in a bundle table node on the tree and display them on the GUI.
Hi @ksugai,
We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.
If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.
Sorry for the late reply due to the company being closed during the year-end and New Year holidays.
What I really want to do is store Array or Table type information in a bundle cell.
I know that Array or Table type can be directly stored in a non-bundle table. However, I would like to store them somehow in a bundle table since the data table may contain hundreds of thousands of rows.
To do this, I am thinking of converting Array and Table to string and storing them in bundle cells in the format that is displayed when returning Array or Table in the script console.
I would like to know if there is an easy way to convert data to string like this.
You can try using the JSON methods:
Array test=[1,2,3]; return JSON.stringify(test);
and
string s="[1,2,3]"; return JSON.parse(s);
Thank you for your reply.
I tried JSON methods and found that ASCII characters can be converted to string as intended.
However, multibyte characters are converted to Unicode escape sequences.
I understand that it can be restored with JSON.parse(), but I would like the user to be able to understand the contents by just looking at the string.
If there is a way to convert multibyte characters to string, please let me know.
You could concatenate with a delimeter into a single string to store in the bundle
Array a=["a","b","c"]; return a.join(","); // "a,b,c"
and then when you need the array of values use the string method 'split' to generate the array.
string s="a,b,c"; return s.split(","); // ["a","b","c"]
14 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