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# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
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
Exception | Condition |
---|---|
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. |