NewModelText Method


Create a model text in the Autodesk Revit family document.

Namespace: Autodesk.Revit.Creation
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)

Syntax

C#
public ModelText NewModelText(
	string text,
	ModelTextType modelTextType,
	SketchPlane sketchPlane,
	XYZ position,
	HorizontalAlign horizontalAlign,
	double depth
)
Visual Basic
Public Function NewModelText ( _
	text As String, _
	modelTextType As ModelTextType, _
	sketchPlane As SketchPlane, _
	position As XYZ, _
	horizontalAlign As HorizontalAlign, _
	depth As Double _
) As ModelText
Visual C++
public:
ModelText^ NewModelText(
	String^ text, 
	ModelTextType^ modelTextType, 
	SketchPlane^ sketchPlane, 
	XYZ^ position, 
	HorizontalAlign horizontalAlign, 
	double depth
)

Parameters

text
Type: SystemString
The text to be displayed.
modelTextType
Type: Autodesk.Revit.DBModelTextType
The type of model text. If this parameter is a null reference (Nothing in Visual Basic), the default type will be used.
sketchPlane
Type: Autodesk.Revit.DBSketchPlane
The sketch plane of the model text. The direction of model text is determined by the normal of the sketch plane. To extrude in the other direction set the depth value to negative.
position
Type: Autodesk.Revit.DBXYZ
The position of the model text. The position must lie in the sketch plane.
horizontalAlign
Type: Autodesk.Revit.DBHorizontalAlign
The horizontal alignment.
depth
Type: SystemDouble
The depth of the model text.

Return Value

If successful, the newly created model text is returned, otherwise an exception with error information will be thrown.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException Thrown when the input argument text, sketchPlane or XYZ is a null reference (Nothing in Visual Basic).
Autodesk.Revit.ExceptionsArgumentException Thrown when input argument text is an empty string. Thrown when input argument horizontalAlign or depth is invalid.
Autodesk.Revit.ExceptionsInvalidOperationException Thrown when model text creation failed.

See Also