Open transaction error

Can someone please explain this error to me?

Is something like this, downstream in the graph, considered “open” and causing the error?

Try putting a node called Transaction.End between CurrentDocument and Document.EnableWorksharing.

If that doesn’t work then you might have to jump into Python to force the transaction to be closed before you call the method for enabling worksharing. The thing is that dynamo really doesn’t like closing transactions because then it has to start them again, and there is a little bit of performance overhead associated with that. Most operations in Dynamo are actually batch processed under the same transaction.


Great, thank you @Konrad_K_Sobon! That node appears to have solved the issue for now.

@Konrad_K_Sobon, in simple terms can you explain what adding this node did, please?!?

1 Like

Everything you do in Revit is handled by a transaction - This enables the name you see in the undo feature and the ability to, safely, undo actions taken.

Dynamo operates in the idle thread of Revit - or the idle transaction which means, when nothing else is happening, you can do stuff to the Revit project (Called a document).

You’ll notice that if Revit is halfway through a command (Say you clicked on draw model line, but didn’t yet place it) Dynamo won’t run. That’s because Revit has started a transaction - but not completed it. In this case, you have to end that transaction in order to access the idle thread again … where you can again do stuff to Revit!

The node you chose to use; Transaction.End forces an end to the current transaction.

Hopefully that somewhat explains what’s going on :slight_smile:

1 Like

Very helpful, thank you!

1 Like