SpotDimension Class


An object that represents a spot dimension within the Revit project.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.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

Copy C#
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);
}
Copy VB.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

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →