RebarShapeSetEndTreatmentTypeId Method |
Sets the EndTreatmentType id at the specified rebar shape end.
Namespace: Autodesk.Revit.DB.StructureAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic void SetEndTreatmentTypeId(
ElementId endTreatmentId,
int iEnd
)
Public Sub SetEndTreatmentTypeId (
endTreatmentId As ElementId,
iEnd As Integer
)
public:
void SetEndTreatmentTypeId(
ElementId^ endTreatmentId,
int iEnd
)
member SetEndTreatmentTypeId :
endTreatmentId : ElementId *
iEnd : int -> unit
Parameters
- endTreatmentId ElementId
-
The id of an EndTreatmentType element, or invalidElementId if the rebar shape should have no end treatment at the specified end.
- iEnd Int32
-
0 for the start end treatment, 1 for the end end treatment.
Exceptions
Example#region Autodesk.Revit.DB.Structure.ReinforcementSettings
private bool SetEndTreatmentType(Document doc, RebarShape rebarShape)
{
bool set = false;
ReinforcementSettings settings = ReinforcementSettings.GetReinforcementSettings(doc);
if (!settings.RebarShapeDefinesEndTreatments)
{
try
{
settings.RebarShapeDefinesEndTreatments = true;
}
catch (Exception e)
{
TaskDialog.Show("Revit", e.Message);
}
}
if (settings.RebarShapeDefinesEndTreatments)
{
EndTreatmentType treatmentType = EndTreatmentType.Create(doc, "Flame Cut");
rebarShape.SetEndTreatmentTypeId(treatmentType.Id, 0);
ElementId treatmentTypeId = EndTreatmentType.CreateDefaultEndTreatmentType(doc);
rebarShape.SetEndTreatmentTypeId(treatmentTypeId, 1);
set = true;
}
return set;
}
#endregion
#Region "Autodesk.Revit.DB.Structure.ReinforcementSettings"
Private Function SetEndTreatmentType(doc As Document, rebarShape As RebarShape) As Boolean
Dim [set] As Boolean = False
Dim settings As ReinforcementSettings = ReinforcementSettings.GetReinforcementSettings(doc)
If Not settings.RebarShapeDefinesEndTreatments Then
Try
settings.RebarShapeDefinesEndTreatments = True
Catch e As Exception
TaskDialog.Show("Revit", e.Message)
End Try
End If
If settings.RebarShapeDefinesEndTreatments Then
Dim treatmentType As EndTreatmentType = EndTreatmentType.Create(doc, "Flame Cut")
rebarShape.SetEndTreatmentTypeId(treatmentType.Id, 0)
Dim treatmentTypeId As ElementId = EndTreatmentType.CreateDefaultEndTreatmentType(doc)
rebarShape.SetEndTreatmentTypeId(treatmentTypeId, 1)
[set] = True
End If
Return [set]
End Function
#End Region
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