ElementDemolished |
| Exception | 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. |
void ShowPhaseDemolishedName(Element element) { // Get the Phase Demolished property, and check whether it be null 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 { // Show the Phase Demolished name to the user. String prompt = "The phase demolished is: " + phaseDemolished.Name; TaskDialog.Show("Revit",prompt); } }