<?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: Failed to perform the Boolean operation in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/failed-to-perform-the-boolean-operation/m-p/11495497#M16129</link>
    <description>&lt;P&gt;Dear Miguel,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see your pictures and your code, but they do not tell me what the problem is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you be more specific? Otherwise, I have to reverse engineer your code, try to guess what you are trying to achieve, and try to guess what the problem might be. That is a rather laborious and error-prone approach to the issue.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, I did find a rather obscure suggestion to address that particular error under certain circumstances back in 2015:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2015/05/cloning-a-solid-angelhack-3d-web-fest-and-dubai.html#6" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2015/05/cloning-a-solid-angelhack-3d-web-fest-and-dubai.html#6&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe not so relevant for your current situation, but who knows?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 08:38:36 GMT</pubDate>
    <dc:creator>jeremy_tammik</dc:creator>
    <dc:date>2022-10-20T08:38:36Z</dc:date>
    <item>
      <title>Failed to perform the Boolean operation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/failed-to-perform-the-boolean-operation/m-p/11494771#M16128</link>
      <description>&lt;P&gt;Hope everyone is doing well, the operation I need to execute is a intersection between the room solid space and a solid extrusion from wall faces. In my las post I solved a similar issue by placing a single wall and editing the profile:&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="MiguelGT17_1-1666220877809.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1129568i373F9D6CE0AA201C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MiguelGT17_1-1666220877809.png" alt="MiguelGT17_1-1666220877809.png" /&gt;&lt;/span&gt;&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="MiguelGT17_0-1666220837133.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1129566i7F2B6FA732106971/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MiguelGT17_0-1666220837133.png" alt="MiguelGT17_0-1666220837133.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, in this next scenario I have a completely different kitchen layout and the problem comes up with the dining room:&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MiguelGT17_3-1666221057614.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1129570i501CF2A7DF505236/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MiguelGT17_3-1666221057614.png" alt="MiguelGT17_3-1666221057614.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is a small piece of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;			//Set BoundarySegments Options
			SpatialElementBoundaryOptions  sebOptions = new SpatialElementBoundaryOptions{
				SpatialElementBoundaryLocation= SpatialElementBoundaryLocation.Finish
			};
			
			
			//Eliminate or ignore null room location
			List&amp;lt;SpatialElement&amp;gt; allRoomsInModel = new FilteredElementCollector(doc).OfClass(typeof(SpatialElement)).WhereElementIsNotElementType().Cast&amp;lt;SpatialElement&amp;gt;().Where(x =&amp;gt; x.Category.Name == "Rooms" &amp;amp;&amp;amp; x.Location != null).ToList();
			if (allRoomsInModel.Any()) {
				foreach (SpatialElement element in allRoomsInModel) {
					
					Room room = element as Room;
					double roomWallFinishArea = 0;
					
					if (room != null ) {
						
						if (room.Name != "DINING 99") {
							continue;
						}
						
						
						SpatialElementGeometryResults results2 = cal.CalculateSpatialElementGeometry(room);
						Solid roomSolid2 = results2.GetGeometry(); //GetSolid from spatial geometry
						
						List&amp;lt;double&amp;gt; areas = new List&amp;lt;double&amp;gt;();
						
						#region 2.3) Wall Finish
						foreach (Face roomFace in roomSolid2.Faces) {
							// Filter spatial room Face by same wall Id from wall retrieved from bounding segment, instead of doing FaceNormal.Z != 1 ...etc.
							IList&amp;lt;SpatialElementBoundarySubface&amp;gt; boundaryGeometryInfoList = results2.GetBoundaryFaceInfo(roomFace);//it will retrieve INFO for geometry boundary that define this specific spatial roomFace
							foreach (SpatialElementBoundarySubface boundaryGeometryInfo in boundaryGeometryInfoList)//for each wall Info get Face info
							{
								if (boundaryGeometryInfo.SubfaceType == SubfaceType.Side) //Work with boundary geometry info that is a side face type
								{
									//get element that gave rise to this geometry face &amp;lt;&amp;gt; wall face
									Wall wall = doc.GetElement(boundaryGeometryInfo.SpatialBoundaryElement.HostElementId) as Wall;
									if (wall != null) {
										
										
										
										//Face of the bounding wall ()
										Face wallFace = boundaryGeometryInfo.GetBoundingElementFace();
										if (wallFace is PlanarFace) {
											//planarFace of the bounding wall
											PlanarFace planarWallFc = wallFace as PlanarFace;
											if (!areas.Contains(wallFace.Area)) {
												//tailorBird.tessellateFace(wallFace,doc);
												
												#region 2.3.1). Create Solid from opening inserts in each boundary wall
												IList&amp;lt;ElementId&amp;gt; wallInserts = wall.FindInserts(true,false,true,true);
												Solid overallOpeningSolid = null;
												if (wallInserts.Any()) {
													foreach (ElementId idinsert in wallInserts) {
														Element insert = doc.GetElement(idinsert);
														FamilyInstance famIns = insert as FamilyInstance;
														XYZ pCutDir = XYZ.Zero;
														CurveLoop curveLoop = ExporterIFCUtils.GetInstanceCutoutFromWall(doc,wall,famIns,out pCutDir);
														/// ExporterIFCUtils.ComputeAreaOfCurveLoops( loops )
														
														
														IList&amp;lt;CurveLoop&amp;gt; profileLoops = new List&amp;lt;CurveLoop&amp;gt;();
														profileLoops.Add(curveLoop);
														if (overallOpeningSolid == null) {
															Solid negExt = GeometryCreationUtilities.CreateExtrusionGeometry(profileLoops,-pCutDir,1);
															Solid posExtr = GeometryCreationUtilities.CreateExtrusionGeometry(profileLoops,pCutDir,1);
															overallOpeningSolid =  BooleanOperationsUtils.ExecuteBooleanOperation(negExt,posExtr,BooleanOperationsType.Union);
														
														}
														else if (overallOpeningSolid != null) {
															Solid negExt = GeometryCreationUtilities.CreateExtrusionGeometry(profileLoops,-pCutDir,1);
															Solid posExtr = GeometryCreationUtilities.CreateExtrusionGeometry(profileLoops,pCutDir,1);
															Solid openingSolid = BooleanOperationsUtils.ExecuteBooleanOperation(negExt,posExtr,BooleanOperationsType.Union);
															overallOpeningSolid = BooleanOperationsUtils.ExecuteBooleanOperation(overallOpeningSolid,openingSolid,BooleanOperationsType.Union);
														}
													}
												}
												#endregion
												
												#region 2.3.2). Create solid from bondary wall face
												Solid wallFaceExtrus = GeometryCreationUtilities.CreateExtrusionGeometry(planarWallFc.GetEdgesAsCurveLoops(),planarWallFc.FaceNormal,0.1);
												//make sure the wallFaceExtruded it's surrounding the room (roomSolid is produced by wall faces, so they have same height, although width is variable that's why we intersect both solids)
												TaskDialog.Show("de",wall.Id.ToString());
												wallFaceExtrus = BooleanOperationsUtils.ExecuteBooleanOperation(roomSolid2,wallFaceExtrus,BooleanOperationsType.Intersect);
													
												#endregion
												
												
												areas.Add(wallFace.Area);
											}
										}
									}
								}
							}
						}
						#endregion
						
					}
				}
			}
			&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm attaching the revit project:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MiguelGT17_4-1666222505134.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1129581i7F633D7DE965F665/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MiguelGT17_4-1666222505134.png" alt="MiguelGT17_4-1666222505134.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help with this one please, thanks you in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Miguel G.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 23:36:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/failed-to-perform-the-boolean-operation/m-p/11494771#M16128</guid>
      <dc:creator>MiguelGT17</dc:creator>
      <dc:date>2022-10-19T23:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to perform the Boolean operation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/failed-to-perform-the-boolean-operation/m-p/11495497#M16129</link>
      <description>&lt;P&gt;Dear Miguel,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see your pictures and your code, but they do not tell me what the problem is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you be more specific? Otherwise, I have to reverse engineer your code, try to guess what you are trying to achieve, and try to guess what the problem might be. That is a rather laborious and error-prone approach to the issue.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, I did find a rather obscure suggestion to address that particular error under certain circumstances back in 2015:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2015/05/cloning-a-solid-angelhack-3d-web-fest-and-dubai.html#6" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2015/05/cloning-a-solid-angelhack-3d-web-fest-and-dubai.html#6&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe not so relevant for your current situation, but who knows?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 08:38:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/failed-to-perform-the-boolean-operation/m-p/11495497#M16129</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-10-20T08:38:36Z</dc:date>
    </item>
  </channel>
</rss>

