Is it possible set the demolished phase of elements to “None” by Dynamo?
Our background: We use a different program for out cost estimations which needs an IFC-file to work with. Because of the limitations in the Revit IFC-Export we need to set up a separate demolition phase, which is obviously not ideal, but no way around that, if we want to distinguish the demolished elements in the calculation program.
To make the phase-management in Revit easier, I want to set the demolished phase automatically with dynamo.
The definition I have so far is fairly simple. I can set the demolished phase to a different phase, but I can’t set it to None. I have tried None, Null, 0, empty list. Any suggestions? Or is this one of those cases that can only by solved by python?
# Copyright(c) 2016, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net
# Import Element wrapper extension methods
# Import DocumentManager and TransactionManager
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
# Import RevitAPI
from Autodesk.Revit.DB import *
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
#The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN
def ProcessList(_func, _list):
return map( lambda x: ProcessList(_func, x) if type(x)==list else _func(x), _list )
if isinstance(IN, list):
elements = ProcessList(Unwrap, IN)
elements = [Unwrap(IN)]
errorReport = None
output = ProcessList(SetPhaseToNone, elements)
# if error accurs anywhere in the process catch it
errorReport = traceback.format_exc()
#Assign your output to the OUT variable
if errorReport == None:
OUT = output
OUT = errorReport
I have similar issue. Because Revit won’t export elements that have “Phase Demolished” set to something to IFC file (logic is that they are demolished and won’t exist). I need to change all of them back to “Phase Demolished: none”. But I’m able to only get it working partially (not for all the elements) - using the same Python script suggested in this topic.
I have tried different ways of selecting items (all in active view and by category). Seems that it’s working in a selecting only couple of times, or in some small demo project…