Revit .NET Addin Wizard (RevitAddinWizard) build #0.9.8 has been rolled out. It has four more Revit Addin Coder items added, External Command Updater, External Command Updater, Namespace Replacer, and Transaction Starter.
Let’s demonstrate the Transaction Starter coder a bit in this post.
When the coder button is pressed and the cursor is placed inside a good method, the following C# code will be created supposing the source file is in the same language:
using (Transaction trans1 = new Transaction(CachedDoc, "Execute"))
{
trans1.Start();
//TODO: Do operations in the transaction.
trans1.Commit();
}
Then transaction-handling code can be added easily to the transaction starter code. It’s far from some simple copy and paste. In fact, the Transaction Starter is much smarter than it looks. If the method name is changed or other than “Execute”, there are already some Transaction instances before the line of code, or some other Revit Document variables are in the scope for example, you will notice its brightness a bit when trying it again.
The coder/widget along with a lot more other coders and widgets has been incorporated into the latest RevitAddinWizard Revit .NET Addin Wizard (RevitAddinWizard), which can be downloaded from the Download link of the blog index page.
Recent Comments