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…
Turns out, transaction End is a node.
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?
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.