© 2010 Autodesk
Introduction to Revit 2011 API
§
<VB.NET>
    ''  show the location information of the given element.
    Public Sub ShowLocation(ByVal elem As Element)
        Dim s As String = "Location Information: " + vbCr + vbCr
        Dim loc As Location = elem.Location
 
        If TypeOf loc Is LocationPoint Then
            '' (1) we have a location point
            Dim locPoint As LocationPoint = loc
            Dim pt As XYZ = locPoint.Point
            Dim r As Double = locPoint.Rotation
            ... 
        ElseIf TypeOf loc Is LocationCurve Then
            '' (2) we have a location curve
            Dim locCurve As LocationCurve = loc
            Dim crv As Curve = locCurve.Curve
            ...
                       s = s + "EndPoint(0)/Start Point = " + PointToString(crv.EndPoint(0))
            s = s + "EndPoint(1)/End point = " + PointToString(crv.EndPoint(1))
            s = s + "Length = " + crv.Length.ToString + vbCr
        End If
               … 
    End Sub
 </VB.NET>
DB Element
Location
DB Element Location.PNG