I am trying to make a graph that can query the visibilty display settings of New, Existing, Demolished, and Temporary phased elements in a Phase Filter. There does not seem to be a parameter indicating these settings when examining the Phase filter. Is it possible to find these using Python in Dynamo?
Hi @martin.scholl,
Is that what you are looking for ?
Get phase filter :
import clr
# Import Element wrapper extension methods
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
# Import RevitAPI
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
#The inputs to this node will be stored as a list in the IN variables.
phases = FilteredElementCollector(doc).OfClass(PhaseFilter).ToElements()
#Assign your output to the OUT variable.
OUT = phases
Get phase Presentation :
import clr
# Import Element wrapper extension methods
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
# Import RevitAPI
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
def tolist(obj1):
if hasattr(obj1,'__iter__'): return obj1
else: return [obj1]
#The inputs to this node will be stored as a list in the IN variables.
phases = UnwrapElement(tolist(IN[0]))
new=[]
existing=[]
demolished=[]
temporary=[]
for phase in phases :
news=phase.GetPhaseStatusPresentation(ElementOnPhaseStatus.New)
new.append(news)
existings=phase.GetPhaseStatusPresentation(ElementOnPhaseStatus.Existing)
existing.append(existings)
demolisheds=phase.GetPhaseStatusPresentation(ElementOnPhaseStatus.Demolished)
demolished.append(demolisheds)
temporaries=phase.GetPhaseStatusPresentation(ElementOnPhaseStatus.Temporary)
temporary.append(temporaries)
#Assign your output to the OUT variable.
OUT = new,existing,demolished,temporary
2 Likes
This is exactly what I wanted. Thank you!