Revit 2025 API
DocumentRegenerate Method |
Updates the elements in the Revit document to reflect all changes.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax

Exception | Condition |
---|---|
RegenerationFailedException |
Thrown when the operation fails.
|
InvalidOperationException | Modification of the document is forbidden. Typically, this is because there is no open transaction; consult documentation for Document.IsModified for other possible causes. |

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.

FamilyInstance instance = doc.Create.NewFamilyInstance(new XYZ(15, 20, 0), familySymbol, StructuralType.NonStructural); FamilyInstance instance2 = doc.Create.NewFamilyInstance(new XYZ(25, 30, 0), familySymbol, StructuralType.NonStructural); // faster to create multiple instances without calling Regenerate after each one LocationPoint point = instance.Location as LocationPoint; // this data is incorrect because the new geometry has not yet been regenerated doc.Regenerate(); point = instance.Location as LocationPoint; // now it is correct
Dim instance As FamilyInstance = doc.Create.NewFamilyInstance(New XYZ(15, 20, 0), familySymbol, StructuralType.NonStructural) Dim instance2 As FamilyInstance = doc.Create.NewFamilyInstance(New XYZ(25, 30, 0), familySymbol, StructuralType.NonStructural) ' faster to create multiple instances without calling Regenerate after each one Dim point As LocationPoint = TryCast(instance.Location, LocationPoint) ' this data is incorrect because the new geometry has not yet been regenerated doc.Regenerate() point = TryCast(instance.Location, LocationPoint) ' now it is correct
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also