question

j08j avatar image
0 Likes"
j08j asked j08j commented

Flexscript coding problem

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.

FlexSim 24.0.2
flexscriptcodeflexscript coding
· 2
5 |100000

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

Jeanette F avatar image Jeanette F ♦♦ commented ·

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 0 ·
j08j avatar image j08j commented ·
Can anyone help me with this issue?

Thanks a lot.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered j08j commented

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

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

capture1.png


capture1.png (11.1 KiB)
· 1
5 |100000

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

j08j avatar image j08j commented ·
Thanks!
0 Likes 0 ·