Flexscript coding problem

Flexscript coding problem

j08j
Not applicable
1,007 Views
4 Replies
Message 1 of 5

Flexscript coding problem

j08j
Not applicable

[ FlexSim 24.0.2 ]

I use code to create the following two fields. How do I use code to check "Dynamic"?

treenode focus5 = list;
string fieldTypeName5 = "ExpressionField";
treenode newField5 = function_s(focus5, "addField", fieldTypeName5);
newField5.name = "Content";
treenode Expression5 = newField5.find("expression");
string Code5 = "Variant value = param(1);\n\
Variant puller = param(2);\n\
treenode entry = param(3);\n\
double pushTime = param(4);\n\
return /**/value.as(Storage.Slot).slotItems.length/**direct*/;\n\
";
Expression5.value = Code5;

treenode focus6 = list;
string fieldTypeName6 = "LabelField";
treenode newField6 = function_s(focus6, "addField", fieldTypeName6, 1);
newField6.name = "ID";
截圖-2024-05-16-下午25214.png


Thanks.

0 Likes
Accepted solutions (1)
1,008 Views
4 Replies
Replies (4)
Message 2 of 5

Jeanette_Fullmer
Community Manager
Community Manager

Hi @j08j,

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.

0 Likes
Message 3 of 5

j08j
Not applicable
Can anyone help me with this issue?

Thanks a lot.

0 Likes
Message 4 of 5

FelixMoehlmann
Mentor
Mentor
Accepted solution

Setting the "isDynamic" node of the field to 1 should to the trick.

newField.subnodes["isDynamic"].value = 1;

capture1.png

Message 5 of 5

j08j
Not applicable
Thanks!
0 Likes