Updates the elements in the Revit document to reflect all changes.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Syntax
C# |
---|
public void Regenerate() |
Visual Basic |
---|
Public Sub Regenerate |
Visual C++ |
---|
public:
void Regenerate() |
Remarks
Examples
CopyC#
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);
LocationPoint point = instance.Location as LocationPoint;
doc.Regenerate();
point = instance.Location as LocationPoint;
CopyVB.NET
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)
Dim point As LocationPoint = TryCast(instance.Location, LocationPoint)
doc.Regenerate()
point = TryCast(instance.Location, LocationPoint)
Exceptions
Exception | Condition |
---|
Autodesk.Revit.Exceptions..::..RegenerationFailedException |
Thrown when the operation fails.
- If regeneration fails, there is posted error of severity DocumentCorruption that will be delivered to the end user
at the end of transaction explaining what specifically has happened.
- If regeneration has failed, document is corrupted and even reading from it is illegal.
- Code that called regeneration and got this exception should not catch and ignore it - instead, it should do nothing
but internal cleanup and return control to the owner of currently active transaction/subtransaction, which must be aborted.
|
Autodesk.Revit.Exceptions..::..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. |
See Also