question

Gui Vaccaro avatar image
0 Likes"
Gui Vaccaro asked Gui Vaccaro commented

Read macro from table, assign to flexscript label

Hello,

Is there a direct way to have a global table column containing global macros to be read and interpreted as their corresponding macro values. The intent is to have the macro value assigned to an object label, reading from the table.

Example:

Let's say that MyTable[1][1] = MY_MACRO where MY_MACRO is previously defined by

#define MY_MACRO something

Then

myObject.labels["myLabel"].value = MyTable[1][1]; // receive "something", not "MY_MACRO"

I would prefer not having to create a parser function manually, if possible.

Thank you.

FlexSim 25.0.2
tableslabel valueglobal macros
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

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Gui Vaccaro commented

Either set the table cells to contain "FlexScript Data" (Rightclick -> Assign Data -> Assign FlexScript Data) or use the command "executestring()".

In the first case you can still read the string data from the cell by accessing the value of the cell node.

1737531324745.png


1737531324745.png (44.3 KiB)
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.