Hi,
can anyone help me isolate the Z vector in this python script?
This outputs the element curve of in my case a duct.
If i can get the Z Vector or Z values of start and end points i should be able to isolate any vertical ducts.
import clr
#Import Revit Nodes
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference ("DSCoreNodes")
import DSCore
from DSCore import *
doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
curves = list()
vertical = list()
spoint = list()
epoint = list()
for element in elements:
loc = element.Location
if loc.ToString() == 'Autodesk.Revit.DB.LocationCurve':
curvepoints = (loc.Curve.GetEndPoint(0).ToPoint(),loc.Curve.GetEndPoint(1).ToPoint())
curves.append(loc.Curve.ToProtoType())
OUT = curves
#OUT = vertical
any help would be much appreciated!
Thanks,