TextPosition Property


The position of the dimension text's drag point.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2015 Subscription Update

Syntax

C#
public XYZ TextPosition { get; set; }
Visual Basic
Public Property TextPosition As XYZ
	Get
	Set
Visual C++
public:
property XYZ^ TextPosition {
	XYZ^ get ();
	void set (XYZ^ value);
}

Remarks

This property is not applicable to all dimensions. For example, it is not available for spot slope dimensions, multi-segments dimensions, dimensions using equality formula, and when dimension style is ordinate.

If the position is not applicable, this property throws InvalidOperationException.

Examples

Copy C#
    // Get the current text XYZ position
XYZ currentTextPosition = dimToModify.TextPosition;
// Calculate a new XYZ position by transforming the current text position
XYZ newTextPosition = Transform.CreateTranslation(new XYZ(0.0, 1.0, 0.0)).OfPoint(currentTextPosition);
// Set the new text position
dimToModify.TextPosition = newTextPosition;

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException When setting this property: A non-optional argument was null
Autodesk.Revit.Exceptions InvalidOperationException Thrown when:
  • SpotDimension style type is SpotSlope.
  • Using equality formula.
  • Dimension style is ordinate.
-or- Thrown when:
  • SpotDimension has more than one segments.
-or-

See Also