GetPoint Method


Retrieves point of the Analytical Model.

Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2011

Syntax

C#
public XYZ GetPoint()
Visual Basic
Public Function GetPoint As XYZ
Visual C++
public:
XYZ^ GetPoint()

Return Value

Point of the Analytical Model.

Examples

Copy C#
// retrieve and iterate current selected element
UIDocument uidoc = commandData.Application.ActiveUIDocument;
ICollection<ElementId> selectedIds = uidoc.Selection.GetElementIds();
Document document = uidoc.Document;
foreach (ElementId id in selectedIds)
{
    Element e = document.GetElement(id);
    // if the element is structural footing
    FamilyInstance familyInst = e as FamilyInstance;
    if (null != familyInst && familyInst.StructuralType == StructuralType.Footing)
    {
        AnalyticalModel model = familyInst.GetAnalyticalModel();
        // structural footing should be expressable as a single point
        if (model.IsSinglePoint() == true)
        {
            XYZ analyticalLocationPoint = model.GetPoint();
        }
    }
}
Copy VB.NET
' retrieve and iterate current selected element
Dim uidoc As UIDocument = commandData.Application.ActiveUIDocument
Dim selectedIds As ICollection(Of ElementId) = uidoc.Selection.GetElementIds()
Dim document As Document = uidoc.Document
For Each id As ElementId In selectedIds
    Dim e As Element = document.GetElement(id)
    ' if the element is structural footing
    Dim familyInst As FamilyInstance = TryCast(e, FamilyInstance)
    If familyInst IsNot Nothing AndAlso familyInst.StructuralType = StructuralType.Footing Then
        Dim model As AnalyticalModel = familyInst.GetAnalyticalModel()
        ' structural footing should be expressable as a single point
        If model.IsSinglePoint() = True Then
            Dim analyticalLocationPoint As XYZ = model.GetPoint()
        End If
    End If

Exceptions

Exception Condition
Autodesk.Revit.Exceptions InapplicableDataException This AnalyticalModel cannot be expressed as a single point. -or- Disabled Analytical Model can't be used.

See Also