title: Autodesk Revit MEP 2010 .NET API C# room to door relation
body: <p>Working with VS 2008 and Autodesk Revit MEP 2010 in C# I am trying to find out if a door is connecting to rooms:</p>
  
  <pre><code>ElementSetIterator elementsetiteratorBIMDoors = 
    bimdoors.getBIMDoors().ForwardIterator();
  
  while (elementsetiteratorBIMDoors.MoveNext())
  {
      Autodesk.Revit.Element elementDoor = 
        elementsetiteratorBIMDoors.Current as Autodesk.Revit.Element;
  
      if ((null != elementDoor.get_Parameter(BuiltInParameter.FROM_ROOM_ID)) &amp;&amp; 
          (null != elementDoor.get_Parameter(BuiltInParameter.TO_ROOM_ID)))
      {
          string sDoorFromRoomID = 
                elementDoor.get_Parameter(BuiltInParameter.FROM_ROOM_ID).ToString();
          string sDoorToRoomID = 
                elementDoor.get_Parameter(BuiltInParameter.TO_ROOM_ID).ToString();
  
          graph.addLink(new Link(sDoorFromRoomID, sDoorToRoomID));
      }
  }
  </code></pre>
  
  <p>This approach does not work because the return value of <code>elementDoor.get_Parameter(BuiltInParameter.FROM_ROOM_ID)</code> is always <code>null</code>. </p>
  
  <p>I have read on the <a href="http://thebuildingcoder.typepad.com/blog/2009/02/rvtmgddbg.html" rel="nofollow noreferrer">Building Coder blog</a> that </p>
  
  <blockquote>
    <p>Built-in parameters are not an officially supported portion of API. In
    future we expect it will be replaced by data being properly exposed as
    a property.</p>
  </blockquote>
  
  <p>Is that statement true?  Can anyone point me to an efficient way to get the relation between doors and rooms?</p>