IF true? passthrough: Transaction.End

I understand nothing about the Transaction system, but what I’m trying to do is end a branch of my script without returning an error from nodes downstream. I can end a branch with an IF node that returns null, but I’m wondering if there’s a way to end a branch with an IF node that uses Transaction.End?

The Transaction nodes are to have Revit start or stop something at a particular point.

Transaction.End is basically telling Revit to stop take a deep breath and ok now you may continue. Sometimes Revit tries to do something before it has fully completed the task from before.

Not sure why you want to have a Transaction.End only run based on a condition. Can you provide more information on this?

My solution was always to pass a null, generating errors but who cares as that branch doesn’t do anything anyway. You can also wrap each item in a nested function via design script (circumventing the errors in the most obtuse way possible which might actually be a big which could get ‘fixed’ someday) or use a custom node to allow for error handling (effectively the same as the wrapping in design script)

1 Like

Could you post your code ?

It’s a ginormous Batch Plot script, but I basically just want to switch between printers based on user input. I’m using null input right now and it returns an error message when I run it successfully through Dynamo Player. I was hoping I could clean that up a bit, but it sounds like ending a transaction doesn’t stop the branch.

Not the answer you are probably looking for but.

I feel like you could use a single branch for this and just modify the data being passed. Impossible to say without seeing it. Passing the warning created by sending a null along shouldn’t cause any issue though.

Thanks @Steven for guiding @david.burow to my solution…

@david.burow try also to see the entire solution for printing…

2 Likes