change a flexcript node from a code

change a flexcript node from a code

gguedia5QZFN
Enthusiast Enthusiast
528 Views
1 Reply
Message 1 of 2

change a flexcript node from a code

gguedia5QZFN
Enthusiast
Enthusiast

[ FlexSim 23.2.0 ]

hello,

I am trying to change the process time of a processor using a script.

1734681215297.png

I am able to access the node but my changes are not considered.

here is my code

1734681432676.png


0 Likes
Accepted solutions (1)
529 Views
1 Reply
Reply (1)
Message 2 of 2

Paula_LG
Advocate
Advocate
Accepted solution

Hi Gilles,

I've tried this code on a dummy and it works just fine:

string processTimeAuto = "Object current = ownerobject(c);\nObject item = param(1);\nreturn 3600/Table(\"GlobalTable1\")[1][1];";
treenode myNode2 = Model.find("Processor1>variables/cycletime");
myNode2.value = processTimeAuto;
switch_flexscript(myNode2,1);
buildnodeflexscript(myNode2);

It looks like the problem was the way of assigning the string to the node.

I hope it helps!

0 Likes