<?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 Rebar intersection in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-intersection/m-p/8440616#M45826</link>
    <description>&lt;P&gt;&amp;nbsp; &amp;nbsp; How to I detect if 2 rebars (of the same host) intersect with each other? My rebars can be of any shape, any layout rule (but ideally their layout rule should not be "Single").&lt;BR /&gt;I have been tackling this problem for a few days, tried almost anything I can think of:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;1. "JoinGeometryUtils": It can not detect if rebars are "joined" since it only works with solid element. Unfortunately, rebar is not a solid element. It is written in the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Try to use "BuiltInFailure" with a Rebar overlapped definition: 2 rebars are considered overlapped only if they are of the same RebarBarType, the same RebarShape, the same dimension, and the same location. not even close to what I need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Try to manually determine intersection by using Driving curve of the 2 rebars, and I encounter 2 more problems:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; a. Even when I place to straight standard bars&amp;nbsp;so that the 2 rebars completely overlap each other, their driving curves somehow always return a "Disjoin" result. Only when I select the same curve twice, I received the "Equal" result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; b. I haven't try this with every layout rule but it seems to me that only rules with specific number (such as "Fixed number") that I can use&amp;nbsp;&lt;FONT&gt;GetBarPositionTransform&lt;/FONT&gt;() to get all the curves for the bars. The other layout rules (such as "Maximum spacing") always return&amp;nbsp;&lt;FONT&gt;NumberOfBarPositions&lt;/FONT&gt; and&amp;nbsp;&lt;FONT&gt;Quantity&lt;/FONT&gt; as 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What have I done wrong? Is there a way to detect rebar intersection? Thank you all for your time.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Dec 2018 11:10:30 GMT</pubDate>
    <dc:creator>longt61</dc:creator>
    <dc:date>2018-12-03T11:10:30Z</dc:date>
    <item>
      <title>Rebar intersection</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-intersection/m-p/8440616#M45826</link>
      <description>&lt;P&gt;&amp;nbsp; &amp;nbsp; How to I detect if 2 rebars (of the same host) intersect with each other? My rebars can be of any shape, any layout rule (but ideally their layout rule should not be "Single").&lt;BR /&gt;I have been tackling this problem for a few days, tried almost anything I can think of:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;1. "JoinGeometryUtils": It can not detect if rebars are "joined" since it only works with solid element. Unfortunately, rebar is not a solid element. It is written in the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Try to use "BuiltInFailure" with a Rebar overlapped definition: 2 rebars are considered overlapped only if they are of the same RebarBarType, the same RebarShape, the same dimension, and the same location. not even close to what I need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Try to manually determine intersection by using Driving curve of the 2 rebars, and I encounter 2 more problems:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; a. Even when I place to straight standard bars&amp;nbsp;so that the 2 rebars completely overlap each other, their driving curves somehow always return a "Disjoin" result. Only when I select the same curve twice, I received the "Equal" result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; b. I haven't try this with every layout rule but it seems to me that only rules with specific number (such as "Fixed number") that I can use&amp;nbsp;&lt;FONT&gt;GetBarPositionTransform&lt;/FONT&gt;() to get all the curves for the bars. The other layout rules (such as "Maximum spacing") always return&amp;nbsp;&lt;FONT&gt;NumberOfBarPositions&lt;/FONT&gt; and&amp;nbsp;&lt;FONT&gt;Quantity&lt;/FONT&gt; as 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What have I done wrong? Is there a way to detect rebar intersection? Thank you all for your time.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 11:10:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rebar-intersection/m-p/8440616#M45826</guid>
      <dc:creator>longt61</dc:creator>
      <dc:date>2018-12-03T11:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rebar intersection</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-intersection/m-p/8933425#M45827</link>
      <description>&lt;P&gt;I am running into the same situation. Have you found a solution to this situation yet?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:16:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rebar-intersection/m-p/8933425#M45827</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-26T19:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rebar intersection</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rebar-intersection/m-p/8933928#M45828</link>
      <description>&lt;P&gt;I haven't found any solution that can completely solve this problem yet. However, just a few trick/ walk around to solve 1 or 2 specific case and it require the rebar center line must be on the same plane (which) covers most of my requirement):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 1: if the rebar plane are not parallel - aka the center lines of 2 rebars intersect each other on a plane:&lt;/P&gt;&lt;P&gt;- you can get the center lines using &lt;EM&gt;&lt;STRONG&gt;Rebar.&lt;FONT&gt;GetCenterlineCurves&lt;/FONT&gt;()&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;- &lt;/STRONG&gt;&lt;/EM&gt;get the actual rebar number of the Rebar set&lt;EM&gt;&lt;STRONG&gt; Rebar.&lt;FONT&gt;NumberOfBarPositions&lt;/FONT&gt;.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- get the transform of the bar with the &lt;EM&gt;&lt;STRONG&gt;barPositionIndex&lt;/STRONG&gt;&lt;/EM&gt; in&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;Rebar.&lt;FONT&gt;GetCenterlineCurves&lt;/FONT&gt;()&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; by&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;Rebar.GetShapeDrivenAccessor()&lt;FONT&gt;GetBarPositionTransform&lt;/FONT&gt;()&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- then determine if 2 rebar center lines intersect each other (each center line is actually a list of curves thogh)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rebar1.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/661603iA4DF2E7370A239B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="rebar1.png" alt="rebar1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case 2: if the rebar plane are parallel, which means 2 rebar are on the same plane and they are parallel to each other:&lt;/P&gt;&lt;P&gt;- you find out the center point &lt;FONT&gt;of each rebar&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;- compare the distance&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;d&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt; between them with the sum of their radius &lt;EM&gt;&lt;STRONG&gt;(R1 and R2).&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;if &lt;EM&gt;&lt;STRONG&gt;d &amp;gt; R1 + R2&lt;/STRONG&gt;&lt;/EM&gt; then they are not intersect, otherwise, they are.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Note that: the 2 rebar in my case are of &lt;EM&gt;&lt;STRONG&gt;shape drive rebar&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt; with the same shape so instead of the center point, I can get any point at the same position from the same centerline curve. If your rebar are not the same as in my case, it could be more tricky.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="rebar2.PNG" style="width: 637px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/661604i67FE39E6AD829711/image-size/large?v=v2&amp;amp;px=999" role="button" title="rebar2.PNG" alt="rebar2.PNG" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this help. Still open for any suggestion, contribution or (better) an overall solution.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2019 07:25:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rebar-intersection/m-p/8933928#M45828</guid>
      <dc:creator>longt61</dc:creator>
      <dc:date>2019-07-27T07:25:42Z</dc:date>
    </item>
  </channel>
</rss>

