Create Method (Document, String)


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: 24.0.0.0 (24.0.0.0)
Since:  2017

Syntax

C#
public static EndTreatmentType Create(
	Document doc,
	string strTreatment
)
Visual Basic
Public Shared Function Create ( _
	doc As Document, _
	strTreatment As String _
) As EndTreatmentType
Visual C++
public:
static EndTreatmentType^ Create(
	Document^ doc, 
	String^ strTreatment
)

Parameters

doc
Type: Autodesk.Revit.DBDocument
strTreatment
Type: SystemString

Examples

CopyC#
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);
}
CopyVB.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

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →