<?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: Boundary Segments Issue in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8762486#M42730</link>
    <description>&lt;P&gt;Hello Jeremy,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you so much for your answer...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yeah i thought about putting together the segments which have got the same element, that might be a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;concerning the corners, when you say max and min XYZ coordinates you mean the GetEndPoint() method, dont you? if you do, then i would&amp;nbsp; have a problem with the stem segments. based on the image on the right wall you can see two segments, light blue and dark blue. It means that for light blue, one point would be the corner but the other point is touching the adjacent point at the dark blue segment. For that condition, it would be pretty hard to tell the program which point is located at the corner.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If i assure to have only four segments bounding the room would be easier to get the corners.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Greeting,&lt;/P&gt;
&lt;P&gt;Juan Avila&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2019 15:22:22 GMT</pubDate>
    <dc:creator>juanquis_avila</dc:creator>
    <dc:date>2019-04-30T15:22:22Z</dc:date>
    <item>
      <title>Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8759586#M42728</link>
      <description>&lt;P&gt;Hello devs,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've got a question concerning segment that bound a space. In theory, for just a single room, I should have 4 segments per room but in most cases I've got more than 4 segments and i guess this happens because there are some other elements which divide those segments (like a wall). Below you can find a picture with more information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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="image.png" style="width: 456px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/631130i25726D87F249E45E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example. For this particular case I'm expecting to have 4 segment but im getting 6 instead due the perpendicular walls which are dividing the segment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is: is there any way to get only the 4 segments?&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;What I'm trying to accomplish is to get the four corners of a room!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Thank you guys. you are all AWESOME &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 13:42:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8759586#M42728</guid>
      <dc:creator>juanquis_avila</dc:creator>
      <dc:date>2019-04-29T13:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8761373#M42729</link>
      <description>&lt;P&gt;You assumption is correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The separate segments stem from different elements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that you can query each boundary segment for the element that is producing it using its ElementId property:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://apidocs.co/apps/revit/2019/eaf7d628-d9c2-80a3-2fd7-00013bab1377.htm" target="_blank"&gt;https://apidocs.co/apps/revit/2019/eaf7d628-d9c2-80a3-2fd7-00013bab1377.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="summary"&gt;&amp;gt; Retrieve the id of the element that produces this boundary segment. If the segment is created from an element in a link, this is the id of the RevitLinkInstance.&lt;/DIV&gt;
&lt;DIV class="summary"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="summary"&gt;To obtain just four segments for your square room, you can perform some geometric analysis to combine collinear segments into longer pieces.&lt;/DIV&gt;
&lt;DIV class="summary"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="summary"&gt;If all you need are the four corners, you can (much more) easily determine those by stepping through all the segments (optionally tessellated, if they may be curved) and determine their max and min X, Y and Z coordinates.&lt;/DIV&gt;
&lt;DIV class="summary"&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 06:59:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8761373#M42729</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-04-30T06:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8762486#M42730</link>
      <description>&lt;P&gt;Hello Jeremy,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you so much for your answer...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yeah i thought about putting together the segments which have got the same element, that might be a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;concerning the corners, when you say max and min XYZ coordinates you mean the GetEndPoint() method, dont you? if you do, then i would&amp;nbsp; have a problem with the stem segments. based on the image on the right wall you can see two segments, light blue and dark blue. It means that for light blue, one point would be the corner but the other point is touching the adjacent point at the dark blue segment. For that condition, it would be pretty hard to tell the program which point is located at the corner.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If i assure to have only four segments bounding the room would be easier to get the corners.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Greeting,&lt;/P&gt;
&lt;P&gt;Juan Avila&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 15:22:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8762486#M42730</guid>
      <dc:creator>juanquis_avila</dc:creator>
      <dc:date>2019-04-30T15:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8766232#M42731</link>
      <description>&lt;P&gt;Hi Juan,&lt;/P&gt;
&lt;P&gt;Just a clarification :&lt;/P&gt;
&lt;P&gt;Most of the time having 2 BoundarySegment which are the same direction one after the other means that you have 2 different walls behind them (for example one with insulation and the other without).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your question of retrieving the corners / simplifying your contour, I would rather try to simplify than retrieve the corners. Here is a solution you could implement :&lt;/P&gt;
&lt;P&gt;- for consecutive BoundarySegments, check their directions (if your BoundarySegment's Curve is a Line, you can use the Line's Direction). If the directions are the same, then you can simplify the 2 curves by mutualizing them (for example create a new Line beginning with the first line's end and ending in the other's end).&lt;/P&gt;
&lt;P&gt;- be careful of small length Lines which can connect parallel BoundarySegments (it happens often).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- depending on your algo, use recursion.&lt;/P&gt;
&lt;P&gt;Have fun !&lt;/P&gt;
&lt;P&gt;Benoit&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 08:22:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8766232#M42731</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2019-05-02T08:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8836922#M42732</link>
      <description>&lt;P&gt;Dear Benoit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you very much for your answer... i will check that out and tell you if it works for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cheers and take care.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2019 16:58:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/8836922#M42732</guid>
      <dc:creator>juanquis_avila</dc:creator>
      <dc:date>2019-06-06T16:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/9385271#M42733</link>
      <description>&lt;P&gt;Guys. I might have solved this segment problem! Let me know if anyone is interested to talk about it &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 17:08:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/9385271#M42733</guid>
      <dc:creator>juanquis_avila</dc:creator>
      <dc:date>2020-03-18T17:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/9385279#M42734</link>
      <description>&lt;P&gt;Congratulations!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, sure, please tell us more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 17:11:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/9385279#M42734</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2020-03-18T17:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11732182#M42735</link>
      <description>&lt;P&gt;Hey juanqis,&lt;BR /&gt;&lt;BR /&gt;Do you still have the answer to this problem?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 07:19:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11732182#M42735</guid>
      <dc:creator>olisehemeka_chukwumaC6U52</dc:creator>
      <dc:date>2023-02-06T07:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11732446#M42736</link>
      <description>&lt;P&gt;Funny to get this very old post alive.&lt;/P&gt;&lt;P&gt;I'd change my answer from the time and say:&lt;/P&gt;&lt;P&gt;- sometimes the BoundarySegment list is holed (around windows and at the end of walls ending in the middle of the Room). So you have to close the List, practically we add another Segment to the List.&lt;/P&gt;&lt;P&gt;- check either Douglas Peucker or Visvaligham algorithms, easy to implement and very useful. At least that's what we use and these work fine for us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 09:33:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11732446#M42736</guid>
      <dc:creator>BenoitE&amp;A</dc:creator>
      <dc:date>2023-02-06T09:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11774804#M42737</link>
      <description>&lt;P&gt;Do you have an approach in mind?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 03:22:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11774804#M42737</guid>
      <dc:creator>juanquis_avila</dc:creator>
      <dc:date>2023-02-23T03:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11778346#M42738</link>
      <description>&lt;P&gt;Thank you for the useful pointers and advice! I shared them on the blog:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2023/02/geometry-options-and-clean-simple-curves.html#2" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2023/02/geometry-options-and-clean-simple-curves.html#2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 09:22:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11778346#M42738</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-02-24T09:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary Segments Issue</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11784450#M42739</link>
      <description>&lt;P&gt;Thanks for sharing&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;The algortihms you have provided are great. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 13:44:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boundary-segments-issue/m-p/11784450#M42739</guid>
      <dc:creator>juanquis_avila</dc:creator>
      <dc:date>2023-02-27T13:44:32Z</dc:date>
    </item>
  </channel>
</rss>

