Passtrough node doesnt work as expected

Hi all,
I created a workflow that duplicates the active view, sets the view range of the duplicated view so that only walls are visible.

I used a passthrough node to wait for the duplicated view its view range to be changed before continuing by selecting all wall elements in the duplicated view.
The output however doesnt correspond with the view, it reads the elements before the view range is changed for some reason…

When i run the script again, i get the correct output of elements in that view.

So, i thought the passthrough node was bugged or something, but i get the same problem when i use a codeblock to wait for the view range to be set…

When i run the script again, nothing happens with the initial element list, but if i add a new selectby category node, the list contains the items that are expected.

I have no idea why the wait nodes dont work…

I am not sure why you linked that thread, the solution posted there does not help me I believe…
The pass through nodes are not placed incorrectly i believe…

I believe @solamour solved a similar problem here:

Unfortunately I have no knowledge of transaction end commands…

1 Like

So…

Turns out, transaction End is a node.
This works!
Although i am not sure how, it seems like it doesnt even matter where i put this node. It doesnt even need to pass anything.
As long as it is in my graph the list of elements shows as expected.

Is this because that node ends a transaction and starts a new one?

This is a bit technical, but…

Each run in Dynamo starts a new transaction in Revit. This is a set of commands which push data into the Revit model. Some objects can have their value set and then reported in the same transaction, but generally it’s not a good rule to do this as you might not get the new value just yet. Also some items in Revit can’t ‘live update’ in a single run, so all the more reason to be on the safe side.

By using a Transaction End node you ‘commit’ the commands to Revit and you can the. start a new sequence of commands with a Transaction.Start node. Generally speaking you always want to start a new transaction after the old one finishes, but you should always merge logic sequences before starting a new transaction to ensure there aren’t multiple attempted transactions in one graph (things can get unstable that way).

Note that efforts to alter a Revit file via python usually construct their own transaction controls - you can see this in most of the common Python based packages today.

More information on transactions can be found here: Transactions

3 Likes