Rebar.GetEndTreatmentTypeId
Method
Description:
Get the id of the EndTreatmentType to be applied to the rebar.
Get the id of the EndTreatmentType to be applied to the rebar.
Examples
private void ListEndTreatments(Document doc, List<Rebar> bars)
{
StringBuilder info = new StringBuilder();
for (int n = 0; n < bars.Count; n++)
{
// get end treatment for both ends of bar
for (int i = 0; i < 2; i++)
{
ElementId treatmentTypeId = bars[n].GetEndTreatmentTypeId(i);
if (treatmentTypeId != ElementId.InvalidElementId)
{
EndTreatmentType treatmentType = doc.GetElement(treatmentTypeId) as EndTreatmentType;
info.AppendLine(string.Format("End treatment for bar {0} end {1}: {2}", n, i, treatmentType.EndTreatment));
}
}
}
TaskDialog.Show("Revit", info.ToString());
}
Parameters
Parameter | Type | Description |
---|---|---|
end | Int32 | 0 for the start end treatment, 1 for the end end treatment. |
Return Value
Type | Description |
---|---|
ElementId | The id of a EndTreatmentType, or invalidElementId if the rebar has no end treatment at the specified end. |
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | end must be 0 or 1. |