Hi,
I want to save a value in a vector. I try with an array but I have a lot of problems.
Hi,
I want to save a value in a vector. I try with an array but I have a lot of problems.
The FlexScript Array class has methods such as push() and pop() similar to vectors in other programming languages.
The FlexSim Array class is capitalized. Capitalization matters. The syntax in your script gives a compile error:
array channel = Array(0);
Flexscript Error Unknown type array in declaration of variable channel
This is the syntax you want:
Array channel = Array(num_channels);
See Help > FlexScript API Reference > Array for more examples and documentation on how to use the Array class.
If you need a multi dimensional storage structure at a label, please store the data as a table at label node. You can try to store the table as a bundle structure.
You can set a Vec3 value as an Array into a label. Then you initialize a Vec3 variable with the label values of the Array.
Vec3 curVec3 = Vec3(item.vector[1],item.vector[2],item.vector[3]); // initialize a Vec3 variable with the array values of a label at item curVec3.x += 1; item.size = curVec3;
8 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