Hello all,
For a project I am dealing with adaptive components in my models. I need to get the elevation of the adaptive points in the family. I made a script that collects the points and when you output them you can see that it is a ReferencePoint object with a location XYZ.
However I don’t seem to be able to grab the Z component from this. Point.Z gives me the error ‘AttributeError: ‘ReferencePoint’ object has no attribute ‘Z’’.
Inputting the point into the node ReferencePoint.Z does work, but this is not what I want because I want to contain everything in one script. Does anybody know what could be going on here? Am I missing a reference somewhere?
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
adap_points = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_AdaptivePoints).WhereElementIsNotElementType().ToElements()
z_coord = [point.Z for point in adap_points]
OUT = z_coord