<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Finding a room by wall in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10194867#M27133</link>
    <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the best for me.&lt;BR /&gt;The bounding box and the filter in the room are amazing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Mar 2021 06:41:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-03-29T06:41:08Z</dc:date>
    <item>
      <title>Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10189078#M27128</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you look at the image, there is a red wall and there are rooms up and down.&lt;/P&gt;&lt;P&gt;Can you find rooms with walls?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wallandroom.jpg" style="width: 286px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/898759iA957A27B8867461E/image-size/large?v=v2&amp;amp;px=999" role="button" title="wallandroom.jpg" alt="wallandroom.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What function should I use and how should I access it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var walls = new FilteredElementCollector(document)
                .WhereElementIsNotElementType()
                .OfCategory(BuiltInCategory.OST_Walls)
                .OfClass(typeof(Wall))  
                .Cast&amp;lt;Wall&amp;gt;()
                .Where(x =&amp;gt; x.LevelId.Equals(level.Id));


foreach (var wall in walls)
{
    if (wall.Id.ToString().Equals("3359963"))//wall Id
    {
        var element = document.GetElement(wall.Id);
        var parameter = element.get_Parameter(BuiltInParameter.WALL_ATTR_ROOM_BOUNDING);  // 1 bounding, 0 no bounding
        var value = parameter.AsValueString();
        ;

    }
}&lt;/LI-CODE&gt;&lt;P&gt;I tried, but I have no idea.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 12:01:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10189078#M27128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-26T12:01:47Z</dc:date>
    </item>
    <item>
      <title>Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10189587#M27129</link>
      <description>&lt;P&gt;Retrieve the wall location line. In the middle of the location line, determine a perpendicular point P about the wall width away from the location line. Use the IsPointInRoom method on that point:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2021.1/96e29ddf-d6dc-0c40-b036-035c5001b996.htm" target="_blank"&gt;https://www.revitapidocs.com/2021.1/96e29ddf-d6dc-0c40-b036-035c5001b996.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, better use the GetRoomAtPoint method:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2021.1/656d34c2-1e53-7278-ab83-fefaff7f40a4.htm" target="_blank"&gt;https://www.revitapidocs.com/2021.1/656d34c2-1e53-7278-ab83-fefaff7f40a4.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that you will have different walls on the right and left. Which one do you want?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note that you can have any number of rooms along one asingle wall. Again, which one are you after?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to read more about&amp;nbsp;2D Booleans and Adjacent Areas:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.2" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 14:58:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10189587#M27129</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-03-26T14:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10189608#M27130</link>
      <description>&lt;P&gt;Hi! I think there is no out-of-the-box method to do it. But you can make it yourself. You can try the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;variant 1: get wall core face, create normal to that face as XYZ object and pass it to &lt;A href="https://www.revitapidocs.com/2020/96e29ddf-d6dc-0c40-b036-035c5001b996.htm" target="_blank" rel="noopener"&gt;IsPointInRoom&lt;/A&gt; method to identify&amp;nbsp;first neighboring room; repeat the same with the opposite direction vector to get second room;&lt;/LI&gt;
&lt;LI&gt;variant 2: open transaction, insert temporary door in wall, get its&amp;nbsp;&lt;A href="https://www.revitapidocs.com/2020/c4a37990-0603-50e0-ca97-1cd5449940dd.htm" target="_blank" rel="noopener"&gt;FromRoom&lt;/A&gt; and &lt;A href="https://www.revitapidocs.com/2020/94e34f74-b6d1-2e4b-df44-b93aac5543c6.htm" target="_blank" rel="noopener"&gt;ToRoom&lt;/A&gt; prorerties, rollback transaction to delete temporary door.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I am sure there are other several variants to perform this task.&lt;/P&gt;
&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 15:05:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10189608#M27130</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2021-03-26T15:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10190251#M27131</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;May be this class &lt;A href="https://www.revitapidocs.com/2021.1/7ef1b6ab-3aaa-3ac3-34c3-81d7b44534be.htm" target="_blank" rel="noopener"&gt;BoundingBoxIntersectsFilter&lt;/A&gt; will help you&lt;/P&gt;
&lt;P&gt;It helps me to solve a similar problem. Look at the example below &amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;def get_rooms(wall):
    document = wall.Document
    wall_bb = wall.get_BoundingBox(None)
    outline = Outline(wall_bb.Min, wall_bb.Max)
    bbfilter = BoundingBoxIntersectsFilter(outline)
    rooms = FilteredElementCollector(document).OfCategory(BuiltInCategory.OST_Rooms).\
        WherePasses(bbfilter).ToElements()
    return rooms&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 18:49:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10190251#M27131</guid>
      <dc:creator>SergeyShvydko</dc:creator>
      <dc:date>2021-03-26T18:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10190341#M27132</link>
      <description>&lt;P&gt;Nice. I was not aware the a bounding box intersection filter would honour rooms and their bounding boxes. Very useful indeed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note that you could skip the call to ToElements and just return the filtered element collector directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 19:39:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10190341#M27132</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-03-26T19:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10194867#M27133</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the best for me.&lt;BR /&gt;The bounding box and the filter in the room are amazing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 06:41:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10194867#M27133</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-29T06:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246317#M27134</link>
      <description>&lt;P&gt;Excuse me. Check this post?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I thought this solution was good, but I ran into a big problem.&lt;/P&gt;&lt;P&gt;In that case, like my image, it works perfectly.However, if the wall is diagonal, the meaning of the bounding box disappears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using a solid filter but it didn't work.&lt;/P&gt;&lt;P&gt;Also, it seems impossible to have a bounding box for the curved wall.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any good ideas?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 07:22:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246317#M27134</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-17T07:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246339#M27135</link>
      <description>&lt;P&gt;Yes, the bounding box is always axis aligned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use that as a first rough check. The bounding box filter is a quick filter, which is important:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2015/12/quick-slow-and-linq-element-filtering.html" target="_blank" rel="noopener"&gt;http://thebuildingcoder.typepad.com/blog/2015/12/quick-slow-and-linq-element-filtering.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more precision further down the road, you can use an element intersection or solid intersection filter. They are slow filters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 07:40:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246339#M27135</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-04-17T07:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246401#M27136</link>
      <description>&lt;P&gt;I don't care if I use a slow filter.&lt;/P&gt;&lt;P&gt;But even if I use the solid intersection filter I can't get the value.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I saw it in some post. Solid filters are not detected as intersecting elements that are automatically joined.&lt;/P&gt;&lt;P&gt;So, if you find the solid of the wall and apply the solid filter to find the room, the value does not come out.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;On the other hand, the bounding box intersection filter is evaluated.&lt;/P&gt;&lt;P&gt;Only the difference between the filters is different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an element intersection filter? I couldn't find it.&lt;/P&gt;&lt;P&gt;This is the best if it is obtained as the intersection of the wall and the room.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 08:40:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246401#M27136</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-17T08:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246454#M27137</link>
      <description>&lt;P&gt;The element intersection filter is named ElementIntersectsElementFilter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2021.1/7e54ea68-559b-b449-1d4f-619c4e07f077.htm" target="_blank"&gt;https://www.revitapidocs.com/2021.1/7e54ea68-559b-b449-1d4f-619c4e07f077.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How strange that you could not find it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that it works with a wall. I do not know whether it will work with a room. I will be interested to hear what you discover on that front.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, to use a solid intersection filter with the room, you may be able create the filter from the room's closed shell, if that returns a solid:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2021.1/1a510aef-63f6-4d32-c0ff-a8071f5e23b8.htm" target="_blank"&gt;https://www.revitapidocs.com/2021.1/1a510aef-63f6-4d32-c0ff-a8071f5e23b8.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, you might be able to query the room for its boundary segments closed loop and use that to create a vertical extrusion solid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, for complex adjacency analysis of rooms with vertical walls, I would always prefer to reduce the analysis to a two dimensional problem in the XY plane and use a 2D Boolean library to determine the required relationships.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will give you more analysis functionality with less effort:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.2" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 09:30:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246454#M27137</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-04-17T09:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246530#M27138</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;But my standards are different. I want to find a room by wall.&lt;BR /&gt;What you suggest is to find the walls through the room.&lt;/P&gt;&lt;P&gt;It's the opposite of me. Right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the post I found. Please check.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/questions-about-elementintersectssolidfilter/td-p/7536199" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/questions-about-elementintersectssolidfilter/td-p/7536199&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the same goes for using ElementIntersectsElementFilter.&amp;nbsp;Can't find connected room.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// In this case, the axis is perfect. Diagonal can't.
var neighborRoom = new FilteredElementCollector(Document).OfCategory(BuiltInCategory.OST_Rooms)
.WherePasses(wallBoundingBoxIntersectfilter)
.Cast&amp;lt;Room&amp;gt;()
.ToList();

//If I chose the wall
//test1 :Check the room values ​​in the document.
var test1 = new FilteredElementCollector(Document).OfCategory(BuiltInCategory.OST_Rooms).ToList();

// test2 :When I put a filter on the selected wall, the result is only the  joined walls, and the room could not be found. 
var test2 = new FilteredElementCollector(Document).WherePasses(new ElementIntersectsElementFilter(SelectedWall)).ToList();

// test3 :The result list is 0
var test3 = new FilteredElementCollector(Document).OfCategory(BuiltInCategory.OST_Rooms).WherePasses(new ElementIntersectsElementFilter(SelectedWall)).ToList();


var solids = GetSolids(SelectedWall);
if (solids.Count &amp;gt; 0)
{
  foreach (var solid in solids)
  {
// test 4: Other types of insersects were checked, but Room did not exist.
// result list : panel, wall, structure...
   var test4 = new FilteredElementCollector(Document).WherePasses(new 
    ElementIntersectsSolidFilter(solid)).ToList();
// test 5: Therefore, the list of values ​​is 0
   var test5 = new FilteredElementCollector(Document).OfCategory(BuiltInCategory.OST_Rooms).WherePasses(new ElementIntersectsSolidFilter(solid)).ToList();
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When looking for walls by room, I already found using GetBoundarySegments.&lt;/P&gt;&lt;P&gt;However, in the opposite case, diagonal coordinates, filtering, etc. I cannot currently find.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Apr 2021 10:34:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/10246530#M27138</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-17T10:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a room by wall</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/12477165#M27139</link>
      <description>&lt;P&gt;I see this is marked as solved, but I would utilize RoomBoundarySegments. For each room, access elementIds (bonus: or LinkElementId!) of boundary segments, and check if the list contains your ReferenceWall's ElementId. I could think of a few examples where boundary segments may be slightly buggy here, but almost any other method is preferable (in terms of accuracy, not necessarily robustness) than utilizing boundingboxes IMHO.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 18:14:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/finding-a-room-by-wall/m-p/12477165#M27139</guid>
      <dc:creator>rhanzlick</dc:creator>
      <dc:date>2024-01-04T18:14:20Z</dc:date>
    </item>
  </channel>
</rss>

