Revit 2017.1 API |
AnalyticalModel..::..GetPoint Method |
AnalyticalModel Class Example See Also |
Retrieves point of the Analytical Model.
Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 17.0.0.0 (17.0.1090.0)
Since:
2011
Syntax
Return Value
Point of the Analytical Model.
Examples

// 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(); } } }

' 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. |