Transaction errors - combining built-in and custom components

Yes, you basically have it right. It is also on that page.

Here is the relevant code:

if Trigger:
    # create and start the transaction
    with DB.Transaction(doc, '<give a descriptive name to your transaction>') as t:
        t.Start()
        # change Revit document here
        # commit the changes after all changes has been made
        t.Commit()
1 Like