post

Get Empty Elevation Markers

Here is the Python to get the Markers that have no Elevation on them.
#Copyright (c) 2015 Jason Andersen, andersen.ja@gmail.com
# Default imports
import clr
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
doc =  DocumentManager.Instance.CurrentDBDocument
app =  DocumentManager.Instance.CurrentUIApplication.Application

#The input to this node will be stored in the IN[0] variable and unwrap element
elements = UnwrapElement(IN[0])

#variables
output = []
elemsNotElevation = []
elemsHasElevation = []

#iterate through list and sort
for e in elements:
if e.HasElevations() == False:
elemsNotElevation.append(e)
else:
elemsHasElevation.append(e)

#compile output
output.append(elemsNotElevation)
output.append(elemsHasElevation)

#Assign your output to the OUT variable
OUT = output
Share Button
Follow

Get every new post delivered to your Inbox

Join other followers: