Get and Set values

Does anyone have an idea what is happening over here? I have any complex script and based on the user input the opening can vary, in some cases, I will set some initial values, but at the end, I will calculate values and set it again. Then In the model I have random values (values that are not my first or second value). How can even happen that immediately after writing values Dynamo read (in the very next node) some different values?

Just to add, I know that Dynamo sometimes will “save” some values so I did try with close and open Dynamo method also with Dynamo player but every time I have different variations of the random values.

On my side image can not be displayed, I attached it again, hope it works. I know that transaction will resolve the problem, breaking one run to two did the trick but for me, this is a fundamental question of Dynamo. How it can happen that two nodes in the sequence are not basically connected?

This has very little to do with Dynamo, but quite a bit to do with Revit.

Effectively as you’re doing things in one transaction, element data is sent but not yet written so you’re only able to read the previous value.

Think of it like editing a book. You copy of a page (an element) from the book (the Revit model), and as you look it over you see that the value is 300. You realize this is a typo change it on the page to be 1000, but until you swap the edited page in for the old page in the book (commit the transaction) the value will continue to be 300.

By adding a Transaction.End node in between the Set and Get parameter nodes you’ll get the result you’re after.

All this said, not all elements need this type of control, many values will ‘self publish’ the page as you edit them, but deeper values require this degree of interaction.

Thank you very much Jacob. I thought that if I create a good sequence where all tasks are going in the correct workflow that the Dynamo will follow. I understand perfectly what you described and I did know that the transaction will do the trick but just for a moment, I was uncertain of the Dynamo behavior.

Thank you once again, have a great beginning of the week.

1 Like