Wednesday, December 28, 2011

Strange To Room and From Room Data on Elements

If you have relied on the "To Room" or "From Room" data on an element and didn't always get what you were expecting, I'd be willing to bet that it is due to one of two things. No room elements in the newest phase of your model or refer* to the first reason.

* recursion humor

Room data for the "To Room" and "From Room" parameters on FamilyInstance elements can only read from rooms in the youngest phase in time. This means that any room you place in a previous phase in your model will be ignored in terms of "To Room" and "From Room" no matter what. Confused yet?

Let's say that your model has three phases:

  • Existing
  • Main Construction
  • Future
If you perform most of your modeling and place your rooms in the "Main Construction" phase none of your elements will return a "To Room" or "From Room" element at all unless these rooms are placed in the "Future" phase. Something even a bit more confusing is that your existing doors will report the "To Room" and "From Room" data for the room that exists in the same location in the newest phase.

The image below shows the room data that results from a door selected in a view that is set to the existing phase. There are rooms on either side both places in the existing phase yet the data reported by the door is showing from the future. If the rooms placed in the future phase were deleted, this door would not display any room data even though there are clearly two existing rooms on either side of the door.



The two phases are shown below to help you understand how this door data is coming through the element.



The "To Room" and "From Room" data comes from the rooms placed in the newest phase of your model only so be careful when developing tools that rely on these room settings. You can see below what happens when an element is not adjacent to any rooms in the last phase of your model... you get nothing:


3 comments:

Dima said...

This is funky functionality, thanks for the heads up. So basically this means that if a Door happens to be demolished at any phase there is no way to access its FromRoom, ToRoom or Room property at all. Unless one programmaticly creates a duplicate of this door that is not demolished, queries the Room property values and deletes the redundant door....

Dima

Matt Mason said...

Dima,
Yes - you can... By default the ToRoom/FromRoom gives back the data for the latest phase.
But there is another method signature (where you specify which phase you want the information for) - which will do the job.
-Matt

Dima said...

Yes!!!! Thanks Matt!
I should have looked at the documentation better! I just snooped it and made wrong assumptions

Dima

Post a Comment

Note: Only a member of this blog may post a comment.