<?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: Boolean Operation Fail (solid union) in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/boolean-operation-fail-solid-union/m-p/10129143#M28756</link>
    <description>&lt;P&gt;I solved it myself.&lt;/P&gt;&lt;P&gt;All solids were received as a list and compared.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is unsafe, so it is recommended not to use BooleanOperationsUtils.ExecuteBooleanOperation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Mar 2021 09:17:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-03-04T09:17:34Z</dc:date>
    <item>
      <title>Boolean Operation Fail (solid union)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boolean-operation-fail-solid-union/m-p/10031181#M28755</link>
      <description>&lt;P&gt;&lt;EM&gt;Hello.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There was an error joining the solids.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;“Failed to perform the Boolean operation for the two solids. This may be due to geometric inaccuracies in the solids, such as slightly misaligned faces or edges. If so, eliminating the inaccuracies by making sure the solids are accurately aligned may solve the problem. This also may be due to one or both solids having complexities such as more than two faces geometrically meeting along a single edge, or two coincident edges, etc. Eliminating such conditions, or performing a sequence of Boolean operations in an order that avoids such conditions, may solve the problem.”&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="white-space: pre-wrap;"&gt;private Solid SolidUnion(Solid solid, Solid union)&lt;BR /&gt;{&lt;BR /&gt;  ★ return BooleanOperationsUtils.ExecuteBooleanOperation(solid, union, BooleanOperationsType.Union);&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;LI-CODE lang="csharp"&gt;private Solid GetSolid(Element element)
        {
            Solid solid = null;
            var geometryElement = element.get_Geometry(new Options { IncludeNonVisibleObjects = true } );

            if (geometryElement != null)
            {
                foreach (var geometryObject in geometryElement)
                {
                    // Solid 추출
                    if (geometryObject is Solid geometrySolid &amp;amp;&amp;amp; geometrySolid.Faces.Size &amp;gt; 0 &amp;amp;&amp;amp; geometrySolid.Edges.Size &amp;gt; 0)
                    {
                        if(solid == null)
                        {
                            solid = geometrySolid;
                        }
                        else
                        {
                            solid = SolidUnion(solid, geometrySolid);
                        }
                    }
                    // Solid 변경
                    else if (geometryObject is GeometryInstance geometryInstance)
                    {
                        if (geometryInstance.GetSymbolGeometry() is GeometryElement instanceGeometryElement &amp;amp;&amp;amp;
                           geometryInstance.IsElementGeometry &amp;amp;&amp;amp; geometryInstance.Transform.IsConformal)
                        {
                            foreach (var instanceGeometryObject in instanceGeometryElement)
                            {
                                if (instanceGeometryObject is Solid instanceGeometrySolid &amp;amp;&amp;amp; instanceGeometrySolid.Faces.Size &amp;gt; 0 &amp;amp;&amp;amp; instanceGeometrySolid.Edges.Size &amp;gt; 0)
                                {
                                    if (solid == null)
                                    {
                                        solid = instanceGeometrySolid;
                                    }
                                    else
                                    {
                                        solid = SolidUnion(solid, instanceGeometrySolid);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return solid;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="wall.png" style="width: 351px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/871819i5DF4FA274DEADC6E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wall.png" alt="wall.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please refer to the above source and attached file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The red, orange, and yellow lines are different objects and are joined together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, an error occurs when only the orange Element is initially loaded. Is there a solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason for solid union was to try to perform an interference test because of the complex family, but this error appeared.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if there are any other categories other than walls with these symptoms.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 09:00:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boolean-operation-fail-solid-union/m-p/10031181#M28755</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-26T09:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean Operation Fail (solid union)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boolean-operation-fail-solid-union/m-p/10129143#M28756</link>
      <description>&lt;P&gt;I solved it myself.&lt;/P&gt;&lt;P&gt;All solids were received as a list and compared.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is unsafe, so it is recommended not to use BooleanOperationsUtils.ExecuteBooleanOperation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 09:17:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boolean-operation-fail-solid-union/m-p/10129143#M28756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-04T09:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Boolean Operation Fail (solid union)</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/boolean-operation-fail-solid-union/m-p/11260493#M28757</link>
      <description>&lt;P&gt;Can you provide some sample code to show how to solve this problem?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 09:35:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/boolean-operation-fail-solid-union/m-p/11260493#M28757</guid>
      <dc:creator>guanshijie14</dc:creator>
      <dc:date>2022-06-27T09:35:26Z</dc:date>
    </item>
  </channel>
</rss>

