Element.CreatedPhaseId
Description:
Id of a Phase at which the Element was created.
Id of a Phase at which the Element was created.
Remarks:
After setting the property CreatedPhaseId regeneration can fail if CreatedPhaseId and DemolishedPhaseId are out of order, i.e. their index in the property Document.Phases.
After setting the property CreatedPhaseId regeneration can fail if CreatedPhaseId and DemolishedPhaseId are out of order, i.e. their index in the property Document.Phases.
public ElementId CreatedPhaseId { get; set; }
void ShowPhaseCreatedName(Element element)
{
// Get the Phase Create property, and assert it should not be null
Autodesk.Revit.DB.Phase phaseCreated = element.Document.GetElement(element.CreatedPhaseId) as Phase;
if (null == phaseCreated)
{
throw new Exception("Elements always have a phase for when they are created.");
}
else
{
// Show the Phase Create name to the user.
String prompt = "The phase created is: " + phaseCreated.Name;
TaskDialog.Show("Revit",prompt);
}
}
-
When setting this property: The element does not allow setting the property CreatedPhaseId to the value of createdPhaseId.
-
When setting this property: A non-optional argument was NULL
-
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.