SpotDimension Class


Object representing various types of SpotDimension

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

Syntax

C#
public class SpotDimension : Dimension
Visual Basic
Public Class SpotDimension _
	Inherits Dimension
Visual C++
public ref class SpotDimension : public Dimension

Examples

CopyC#
private void Getinfo_SpotDimension(SpotDimension spotDimension)
{
    string message = "SpotDimension's Location : ";
    Location location = spotDimension.Location;

    if (location is LocationPoint)
    {
        LocationPoint point = location as LocationPoint;

        message += "\n" + location.GetType().Name + " : ";
        message += "(" + point.Point.X + ", " + point.Point.Y + ", " + point.Point.Z + ")";
    }
    else
    {
        LocationCurve locCurve = location as LocationCurve;
        Curve curve = locCurve.Curve;
        message += "\n" + location.GetType().Name + " : ";
        message += "\nStart Point : " + "(" + curve.GetEndPoint(0).X + ", "
                    + curve.GetEndPoint(0).Y + ", " + curve.GetEndPoint(0).Z + ")";
        message += "\nEnd point : " + "(" + curve.GetEndPoint(1).X + ", "
                    + curve.GetEndPoint(1).Y + ", " + curve.GetEndPoint(1).Z + ")";
    }

    TaskDialog.Show("Revit",message);
}
CopyVB.NET
Private Sub Getinfo_SpotDimension(spotDimension As SpotDimension)
    Dim message As String = "SpotDimension's Location : "
    Dim location As Location = spotDimension.Location

    If TypeOf location Is LocationPoint Then
        Dim point As LocationPoint = TryCast(location, LocationPoint)

        message += vbLf + location.[GetType]().Name & " : "
        message += (("(" + point.Point.X & ", ") + point.Point.Y & ", ") + point.Point.Z & ")"
    Else
        Dim locCurve As LocationCurve = TryCast(location, LocationCurve)
        Dim curve As Curve = locCurve.Curve
        message += vbLf + location.[GetType]().Name & " : "
        message += (((vbLf & "Start Point : " & "(") + curve.GetEndPoint(0).X & ", ") + curve.GetEndPoint(0).Y & ", ") + curve.GetEndPoint(0).Z & ")"
        message += (((vbLf & "End point : " & "(") + curve.GetEndPoint(1).X & ", ") + curve.GetEndPoint(1).Y & ", ") + curve.GetEndPoint(1).Z & ")"
    End If

    TaskDialog.Show("Revit", message)
End Sub

Inheritance Hierarchy

SystemObject
  Autodesk.Revit.DBElement
    Autodesk.Revit.DBDimension
      Autodesk.Revit.DBSpotDimension

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →