Possible to access From/To Room Door parameters?


#1

As these parameters do not show up in the Properties palette, it seems I cannot access them with the Element.GetParameterValueByName. Or, perhaps I don’t have the right nomenclature for the parameter name? Fingers crossed.


#2

Sean,

you can access them using Python by passing door elements into the node and then doing something like this:

 

#i am assuming you will pass more than one door in so it will be a list.

doors = []

for i in doors:

doors.append(i.UnwrapElement(i))

#then you can iterate over the list and get the ToRoom and FromRoom parameters

doorToRoom, doorFromRoom = [], []

for i in doors:

doorToRoom.append(i.ToRoom)

doorFromRoom.append(i.FromRoom)

 

Also, don’t forget to import RevitAPI for this to work.

Keep in mind that for some doors that swing into spaces that do not have rooms assigned (exterior) will return a None value. If you want to use these values in some sort of a filter fashion then you might have to skip over None types since it wont be able to use them as an argument.

Good luck!

 


#3

what is the problem?

window.fromroom


#4

The problem is that there are more than 1 property with the same name (FromRoom) with different overload (number of the arguments).

In particular FromRoom returns the room in the last phase of the project and FromRoom(Phase) returns the room in the specified phase. All that Konrad already said remains valid.

I don’t know why exactly I can’t access the first one but the second one you can, if you like you can use this syntax to make it work:

 

window.FromRoom.getitem(doc.Phases[doc.Phases.Size-1])


#5

what am I doing wrong?

why


#6

Hi Legantmar,

Your script is correct. It works fine from my side. Below is the Screenshot. I think its related to your Dynamo. Try this script in other machine.

Untitled

 

 


#7

I think you are doing anything wrong, how many phases do you have in your project? the code is looking for the last phase but there is a possibility that your view (and the room) are assigned to a previous phase.

Or it can be just that the window you selected hasn’t got any value for the FroomRoom property (it depends on the height of the room is higher than the midpoint in height of the window, unless you activated a room control point in the family). Can you verify that please?