RVTDocs.com

FamilyItemFactory.NewModelText

Method
Description:
Create a model text in the Autodesk Revit family document.
Syntax
public ModelText NewModelText(
	string text,
	ModelTextType modelTextType,
	SketchPlane sketchPlane,
	XYZ position,
	HorizontalAlign horizontalAlign,
	double depth
)
Parameters
Parameter Type Description
text String The text to be displayed.
modelTextType ModelTextType The type of model text. If this parameter is <span class="keyword"><span data-languagespecifictext="cpp=nullptr|vb=Nothing|nu=null" id="LST5BA8EE72_1"></span></span>, the default type will be used.
sketchPlane SketchPlane 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 XYZ The position of the model text. The position must lie in the sketch plane.
horizontalAlign HorizontalAlign The horizontal alignment.
depth Double The depth of the model text.
Return Value
Type Description
ModelText If successful, the newly created model text is returned, otherwise an exception with error information will be thrown.
Exceptions
Exception Condition
ArgumentNullException Thrown when the input argument text, sketchPlane or XYZ is.
ArgumentException Thrown when input argument text is an empty string. Thrown when input argument horizontalAlign or depth is invalid.
InvalidOperationException Thrown when model text creation failed.