Work Principle

Dear Experts,
There is big misunderstanding at the work principle of Dynamo :pensive: . Please look at the script below.:
As a brief description:
I want to add A value to Material Name Long parameter then add X value to same Material Name Long parameter. Result must always be AX when i run that script. But when I run several times it is always adding X periodically. (At first run X. Second run XX and so on.)

Help2.dyn (8.1 KB)

Your screenshot isn’t visible due to how you took it. Zoom in on a node so we can read it, ensure all necessary previews are enabled, and then use the camera button in the top right corner of the Dynamo window.

My guess is you are reading the existing value, and appending X, then setting the value, rather than gathering A, gathering X, and then setting the value once.

Dear Experts,
sorry for my mistake. :roll_eyes: I edited my post.

I have not had time to play with this, but I think you probably want to use a transaction.end node to make sure the setParameterValue is executed and the document modified before you try to gather the results.

So how to handle this problem :frowning:

The stuff circled yellow is consistent, but the results of the red circle have changed since the value was last set, so Dynamo is being smart and reevaluating that, and therefore everything with a green circle after it.

You could drastically reduce this graph and circumvent the issue by setting the value once instead of twice.