ElementDemolishedPhaseId Property |
Id of a Phase at which the Element was demolished.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic ElementId DemolishedPhaseId { get; set; }
Public Property DemolishedPhaseId As ElementId
Get
Set
public:
property ElementId^ DemolishedPhaseId {
ElementId^ get ();
void set (ElementId^ value);
}
member DemolishedPhaseId : ElementId with get, set
Property Value
ElementId
ExceptionsException | Condition |
---|
ArgumentException |
When setting this property: The element does not allow setting the property DemolishedPhaseId to the value of demolishedPhaseId.
-or-
When setting this property: Invalid order of phases: An object cannot be demolished before it was created.
|
ArgumentNullException |
When setting this property: A non-optional argument was null
|
InvalidOperationException |
When setting this property: The element does not have properties CreatedPhaseId and DemolishedPhaseId.
-or-
When setting this property: The element does not allow setting the properties CreatedPhaseId and DemolishedPhaseId.
|
Remarks
After setting the property, DemolishedPhaseId regeneration can fail if CreatedPhaseId and DemolishedPhaseId
are out of order with respect to their index in the property Document.Phases.
Can be set to invalid element id.
Examplevoid ShowPhaseDemolishedName(Element element)
{
Autodesk.Revit.DB.Phase phaseDemolished = element.Document.GetElement(element.DemolishedPhaseId) as Phase;
if (null == phaseDemolished)
{
TaskDialog.Show("Revit","This Element doesn't have Phase Demolished parameter.");
}
else
{
String prompt = "The phase demolished is: " + phaseDemolished.Name;
TaskDialog.Show("Revit",prompt);
}
}
Private Sub ShowPhaseDemolishedName(element As Element)
Dim phaseDemolished As Autodesk.Revit.DB.Phase = TryCast(element.Document.GetElement(element.DemolishedPhaseId), Phase)
If phaseDemolished Is Nothing Then
TaskDialog.Show("Revit", "This Element doesn't have Phase Demolished parameter.")
Else
Dim prompt As [String] = "The phase demolished is: " + phaseDemolished.Name
TaskDialog.Show("Revit", prompt)
End If
End Sub
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