In Dynamo 0.7.3 this worked out fine. In 0.7.4 the Element.Document is not accepted anymore and when using the Current Document node, the Doc.Phases statement in my Python isn’t accepted anymore. Any suggestions?
The content of the Python node:
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
Import RevitAPI
clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *
doc= IN[0]
elements =
for i in IN[1]:
elements.append(UnwrapElement(i))
Is there a way to extract the room phases? I have 3 phases with rooms. I cannot filter out the rooms of a particular phase (or is there a way?)
I have excerpts of the script:
##Gather sums of wall / room boundaries based on lengths and directions import clr clr.AddReference(“RevitNodes”) clr.AddReference(‘ProtoGeometry’) import math clr.AddReference(‘RevitAPI’) clr.AddReference(‘RevitAPIUI’) clr.AddReference(“RevitServices”) import RevitServices from RevitServices.Persistence import DocumentManager
for phase in doc.Phases: PhaseList.append(phase.Name)
for item in items: doc = item.Document clist = list()
########################################################################################### #Room Phase Phase=’’ ##initialize to nothing ii=-1 for xphase in doc.Phases: ii=ii+1 if item.CreatedPhaseId == xphase.Id: ##Needs work… needs to red Phase ID to phase name correctly, and doesn’t work… break Phase = PhaseList[ii] clist.append(Phase)