Share

EndTreatmentType.Create(Document, String) Method

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: 25.3.0.0 (25.3.0.0)

Syntax

C#

public static EndTreatmentType Create(
	Document doc,
	string strTreatment
)

Parameters

doc  Document
 
strTreatment  String
 

Return Value

EndTreatmentType

Exceptions

ExceptionCondition
ArgumentNullException A non-optional argument was null

Example

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);
}

VB

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

See Also

Reference

Was this information helpful?