Creates a new EndTreatmentType in a document and adds the input string to the endTreatment parameter.
Namespace:
Autodesk.Revit.DB.Structure
Assembly:
RevitAPI
(in RevitAPI.dll) Version: 17.0.0.0 (17.0.1090.0)
Since:
2017
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Examples
Copy
C#
private void NewEndTreatmentForCouplerType(Document doc, ElementId couplerTypeId)
{
EndTreatmentType treatmentType = EndTreatmentType.Create(doc, "Custom");
FamilySymbol couplerType = doc.GetElement(couplerTypeId) as FamilySymbol;
Parameter param = couplerType.get_Parameter(BuiltInParameter.COUPLER_MAIN_ENDTREATMENT);
param.Set(treatmentType.Id);
}
Copy
VB.NET
Private Sub NewEndTreatmentForCouplerType(doc As Document, couplerTypeId As ElementId)
Dim treatmentType As EndTreatmentType = EndTreatmentType.Create(doc, "Custom")
Dim couplerType As FamilySymbol = TryCast(doc.GetElement(couplerTypeId), FamilySymbol)
Dim param As Parameter = couplerType.Parameter(BuiltInParameter.COUPLER_MAIN_ENDTREATMENT)
param.[Set](treatmentType.Id)
End Sub
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions ArgumentNullException | A non-optional argument was NULL |