Spotted something recently on the web about calling the Revit Document.Regenerate() and the Transaction Commit() .NET API methods:
public bool CreateGirderCircle(...)
{
Transaction tr = new Transaction(m_rvtDoc, "Create Girder");
tr.Start();
//...
//...
m_rvtDoc.Regenerate();
tr.Commit();
//...
}
Is there anything wrong in the above code?
Yes, there is. The Regenerate() call is unnecessary according to the documentation about the method.
"Document.Regenerate Method
…
Use this method to force update to the document after a group of changes. Note that when a transaction is committed there is an automatic call to regenerate the document."
So, there must be something wrong! Is it the documentation out of dated, duplicate effort intended, or simply misunderstanding the sentence?
Revit Addin Wizard (RevitAddinWizard) provides various wizards, coders and widgets to help program Revit addins. It can be downloaded from the Download link at the bottom of the blog index page.
Recent Comments