Hello fellow zero touch developers,
What is the proper way to complete a transaction in Revit (in a dynamo zero-touch node)? I have seen these but not sure what the difference is? Does it matter which set of methods/commands I use in my zero touch nodes? Cannot find any api documention for RevitServices that explains this…
Any explanation would be appreciated. Thanks!
example:
Document doc = DocumentManager.Instance.CurrentDBDocument;
using (Transaction t = new Transaction(doc))
{
t.Start();
//perform some task in current Revit file
t.Commit();
}
}
TransactionManager.Instance.TransactionTaskDone();
or this?
Document doc = DocumentManager.Instance.CurrentDBDocument;
TransactionManager.Instance.EnsureInTransaction(doc);
//do something in Revit here
TransactionManager.Instance.TransactionTaskDone();