<?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: How to know if an element penetrates a wall. in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12904561#M4148</link>
    <description>&lt;P&gt;Did you take the (possible) transformation of the link instance into account? Also, the Face.Intersect(face) is not implemented the way you probably think. It is rather a much too simplistic method which may or may not return correct results. At least Autodesk documented this in 2020 without fixing the actual issue. There is no good and performant replacement, which is why I always try to find ways around intersecting faces in the Revit API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2024/91f650a2-bb95-650b-7c00-d431fa613753.htm" target="_blank" rel="noopener"&gt;https://www.revitapidocs.com/2024/91f650a2-bb95-650b-7c00-d431fa613753.htm&lt;/A&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;EM&gt;This is not a general-purpose function: it only works properly for simple configurations. For other configurations, it may return an incorrect result. Some configurations for which the function might return a correct result are:&lt;/EM&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;A planar face that fully intersects another face in a single curve, when the other face is planar or cylindrical.&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;A cylindrical face that fully intersects another face in a single curve, when the other face is planar.&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 18 Jul 2024 07:03:49 GMT</pubDate>
    <dc:creator>cwaluga</dc:creator>
    <dc:date>2024-07-18T07:03:49Z</dc:date>
    <item>
      <title>How to know if an element penetrates a wall.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12900041#M4143</link>
      <description>&lt;P&gt;Hi, I want to know&amp;nbsp;if an element penetrates a wall.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qoreodlf37_0-1721116053147.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1387160i8963A8BCB76D190D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="qoreodlf37_0-1721116053147.png" alt="qoreodlf37_0-1721116053147.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have tried to wall's two faces(front, back) and determin both face intersect with element solid's faces.&lt;/P&gt;&lt;P&gt;But result always both intersect.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;bool bothFaceIntersect = false;


foreach (PlanarFace face in wallFaceList)// wall's front, back faces
{
    bool isIntersect = false;
    foreach (Face solidFace in _elementSolid.Faces)
    {
        FaceIntersectionFaceResult result = face.Intersect(solidFace);
        if (result != null &amp;amp;&amp;amp; result == FaceIntersectionFaceResult.Intersecting) isIntersect = true;
    }

    if (!isIntersect)
    {
        bothFaceIntersect = false;
        break;
    }
    else bothFaceIntersect = true;
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Jul 2024 07:50:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12900041#M4143</guid>
      <dc:creator>qoreodlf37</dc:creator>
      <dc:date>2024-07-16T07:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to know if an element penetrates a wall.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12900342#M4144</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14260936"&gt;@qoreodlf37&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I don't know what method you have followed to get the Wall's faces, I have created a geometry algorithm for this problem, Kindly follow the below steps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Steps Involved&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Get only Exterior and Interior faces using &lt;A href="https://www.revitapidocs.com/2020/05539c78-f61a-4e75-0a8a-becb0a66b941.htm" target="_blank" rel="noopener"&gt;HostObjectUtils Class&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;2. Get Center Curve for the Element using Bounding Box or Location Curve or using Total Transformation create own.&lt;/P&gt;&lt;P&gt;3. Check whether the face intersects with the curve.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code Snippet&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Wall wall = (Wall)doc.GetElement(new ElementId(308867));
Element element1 = doc.GetElement(new ElementId(309045)); //Duct Element

//Get Front and back Face
Reference extRef = HostObjectUtils.GetSideFaces(wall, ShellLayerType.Exterior).First();
Reference intRef = HostObjectUtils.GetSideFaces(wall, ShellLayerType.Interior).First();

PlanarFace extFace = (PlanarFace)doc.GetElement(extRef).GetGeometryObjectFromReference(extRef);
PlanarFace intFace = (PlanarFace)doc.GetElement(intRef).GetGeometryObjectFromReference(intRef);

///Get Element Center Line
Curve cur1 = (element1.Location as LocationCurve).Curve;

///Get Intersection Result
///Center Line Hitting in both faces ?
if (extFace.Intersect(cur1) == SetComparisonResult.Overlap &amp;amp;&amp;amp; intFace.Intersect(cur1) == SetComparisonResult.Overlap)
{
    TaskDialog.Show("Information", "Element Penetrate into the Wall");
}
else
{
    TaskDialog.Show("Information", "Element does not Penetrate into the Wall");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reference GIF&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wall Element Intersection.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1387221i57CB478C5F44FEBA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Wall Element Intersection.gif" alt="Wall Element Intersection.gif" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this will Helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 10:48:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12900342#M4144</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-07-16T10:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to know if an element penetrates a wall.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12901761#M4145</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;I tried your code, but face.Intersect(curve) always return 'Disjoint' for me.&lt;/P&gt;&lt;P&gt;I used&amp;nbsp;face.Intersect(curve) method in my other project, then it return same things.. so I used other method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I solve this problem with this code.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;double tolerance = 1e-9;

Reference extRef = HostObjectUtils.GetSideFaces(_createWall, ShellLayerType.Exterior).First();
Reference intRef = HostObjectUtils.GetSideFaces(_createWall, ShellLayerType.Interior).First();

PlanarFace extFace = (PlanarFace)_document.GetElement(extRef).GetGeometryObjectFromReference(extRef);
PlanarFace intFace = (PlanarFace)_document.GetElement(intRef).GetGeometryObjectFromReference(intRef);

Solid faceSolid1 = GeometryCreationUtilities.CreateExtrusionGeometry(extFace.GetEdgesAsCurveLoops(), extFace.FaceNormal, 0.001);
Solid oppositeFaceSolid1 = GeometryCreationUtilities.CreateExtrusionGeometry(extFace.GetEdgesAsCurveLoops(), -extFace.FaceNormal, 0.001);

Solid interSolid1 = BooleanOperationsUtils.ExecuteBooleanOperation(faceSolid1, _elementSolid, BooleanOperationsType.Intersect);
Solid oppositeInterSolid1 = BooleanOperationsUtils.ExecuteBooleanOperation(oppositeFaceSolid1, _elementSolid, BooleanOperationsType.Intersect);

Solid faceSolid2 = GeometryCreationUtilities.CreateExtrusionGeometry(intFace.GetEdgesAsCurveLoops(), intFace.FaceNormal, 0.001);
Solid oppositeFaceSolid2 = GeometryCreationUtilities.CreateExtrusionGeometry(intFace.GetEdgesAsCurveLoops(), -intFace.FaceNormal, 0.001);

Solid interSolid2 = BooleanOperationsUtils.ExecuteBooleanOperation(faceSolid2, _elementSolid, BooleanOperationsType.Intersect);
Solid oppositeInterSolid2 = BooleanOperationsUtils.ExecuteBooleanOperation(oppositeFaceSolid2, _elementSolid, BooleanOperationsType.Intersect);

bool extIntersect = interSolid1.Volume &amp;gt;= tolerance || oppositeInterSolid1.Volume &amp;gt;= tolerance;
bool intIntersect = interSolid2.Volume &amp;gt;= tolerance || oppositeInterSolid2.Volume &amp;gt;= tolerance;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Jul 2024 22:39:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12901761#M4145</guid>
      <dc:creator>qoreodlf37</dc:creator>
      <dc:date>2024-07-16T22:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to know if an element penetrates a wall.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12902014#M4146</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14260936"&gt;@qoreodlf37&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;For which element you're trying to find the intersection ?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 03:42:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12902014#M4146</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-07-17T03:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to know if an element penetrates a wall.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12902127#M4147</link>
      <description>&lt;P&gt;a beam element from linked rvt file.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 05:43:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12902127#M4147</guid>
      <dc:creator>qoreodlf37</dc:creator>
      <dc:date>2024-07-17T05:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to know if an element penetrates a wall.</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12904561#M4148</link>
      <description>&lt;P&gt;Did you take the (possible) transformation of the link instance into account? Also, the Face.Intersect(face) is not implemented the way you probably think. It is rather a much too simplistic method which may or may not return correct results. At least Autodesk documented this in 2020 without fixing the actual issue. There is no good and performant replacement, which is why I always try to find ways around intersecting faces in the Revit API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.revitapidocs.com/2024/91f650a2-bb95-650b-7c00-d431fa613753.htm" target="_blank" rel="noopener"&gt;https://www.revitapidocs.com/2024/91f650a2-bb95-650b-7c00-d431fa613753.htm&lt;/A&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;EM&gt;This is not a general-purpose function: it only works properly for simple configurations. For other configurations, it may return an incorrect result. Some configurations for which the function might return a correct result are:&lt;/EM&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;A planar face that fully intersects another face in a single curve, when the other face is planar or cylindrical.&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;A cylindrical face that fully intersects another face in a single curve, when the other face is planar.&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:03:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-know-if-an-element-penetrates-a-wall/m-p/12904561#M4148</guid>
      <dc:creator>cwaluga</dc:creator>
      <dc:date>2024-07-18T07:03:49Z</dc:date>
    </item>
  </channel>
</rss>

