Hello everyone
I am trying to assign some custom code 'on the fly' to the flow level triggers of a FloWorks flow tank, using the following code. The onpassfluidlevel node containing the level trigger code exists of different subnodes, corresponding to each defined level trigger, which require each some specific code.
treenode levelTriggers = getvarnode(flowTank, "onpassfluidlevel"); for (int i = 1; i <= levelTriggers.subnodes.length; i++) { string triggercode = "Object current = ownerobject( c ); Other code to add"; setnodestr(levelTriggers.subnodes[i],triggercode); switch_flexscript(levelTriggers.subnodes[i], 1); } switch_flexscript(levelTriggers, 1); buildnodeflexscript(levelTriggers);
What happens now is that, on executing the buildnodeflexscript command, the sudnodes are built (the red Flescript S in the model tree turns black) but the parent node (onpassfluidlevel) isn't. Hence, the code of the subnodes is not called. I tried to write additional buildnodeflexscript statements, either with the node or the flow tank object as argument, but whatever I tried, the parent node couldn't be built. Does anyone know how this can be overcome?
I post this question here because I think the behaviour is not related to FloWorks specifically, but to building nodes with subnodes in general.
Kind regards
Laurenz Peleman