Create Method (Document, String)


End Treatment Type Create(Document, String) Method

Creates a new EndTreatmentType in the specified document and adds the input string to the endTreatment parameter.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntax
public static EndTreatmentType Create(
	Document doc,
	string treatment
)

Parameters

doc Document
Returns the newly created EndTreatmentType in the specified document.
treatment String
This string will be se to the endTreatment parameter.

Return Value

EndTreatmentType
Returns the newly created EndTreatmentType in the specified document.
Exceptions
Exception Condition
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);
}
See Also
ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →