From Room To Room - Door Schedule

Hello everyone,

I am trying to add the From Room to the door schedule and when the door swings out, I was hoping to get the To Room since the value would be “null”.

I’ve tried to filter the rooms in many different ways but nothing seems to work, as I am still getting empty cells in the door schedule.

Please let me know if you guys have any ideas on how to fix this.

Thanks


Capture1

Hello…could you zoom your image, we cant see whats goin on…

Sorry about that.

1 Like

no worries :wink:

Maybe an extra if statement would do the trick, or a python script…

Hello @khronart

Hope this will solve your problem and you can modify this as per your requirement.
I have used Revit 2019 and Dynamo 2.0.3


Door.FromToRoom.dyn (20.9 KB)

Thank you! would there be a way to get the same amount of From Rooms as To Rooms so I can map them back to the doors? Right now I have 97 doors, 97 From Rooms with null values and only 90 To Rooms.

Hello @khronart,

Those Null or Empty cell you are getting in the doors because there is no room tag assigned on one side or both side of the door. for example main Door / front door of the building.

can you please cross check on the doors with null value, whether room tags are assigned on either side of the door or not?

This is the method I use using my package (Crumple). This will first check if the door has a toroom, and if not it will source its from room instead. Then if it doesn’t have a from room I replace it’s number with an empty field. Function.Apply is able to be used to suppress any errors.

door tofrom.dyn (16.1 KB)

2 Likes

Hi Gavin …does this node work at linked doors as well ?

I may be mistaken, but I believe the to/from room fields are not available when in a linked state. I think the node would technically accept linked doors as elements and a linked phase from the same model (it doesn’t depend on the current document in the python code), but I expect it would return empty values (just like Revit does for to/from linked values).

For reference this is the Python code:

# Made by Gavin Crump
# Free for use
# BIM Guru, www.bimguru.com.au

# Boilerplate text
import clr

clr.AddReference("RevitAPI")
import Autodesk 
from Autodesk.Revit.DB import *

# Define list/unwrap list functions
def uwlist(input):
    result = input if isinstance(input, list) else [input]
    return UnwrapElement(result)

# Preparing input from dynamo to revit
doors = uwlist(IN[0])
phase = UnwrapElement(IN[1])

hasto, hasfrom, counter, torm, fromrm = [],[],[],[],[]

# Do some action in a Transaction
for d in doors:
	if hasattr(d, "FromRoom") and str(phase.GetType()) == "Autodesk.Revit.DB.Phase":
		try:
			torm.append(d.ToRoom[phase])
			fromrm.append(d.FromRoom[phase])
		except:
			torm.append(None)
			fromrm.append(None)

for t,f in zip(torm, fromrm):
	c = 0
	if t == None:
		hasto.append(False)
	else:
		hasto.append(True)
		c+=1
	if f == None:
		hasfrom.append(False)
	else:
		hasfrom.append(True)
		c+=1
	counter.append(c)

# Preparing output to Dynamo
OUT = [torm, fromrm, hasto, hasfrom, counter]
1 Like

This is brilliant, thank you all!

1 Like