<?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: Auto-join between walls and slabs in Revit, BIM 360 &amp; Autodesk Construction Cloud (ACC) - Español</title>
    <link>https://forums.autodesk.com/t5/revit-bim-360-autodesk/auto-join-between-walls-and-slabs/m-p/10938265#M21377</link>
    <description>&lt;P&gt;Hello&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Error means exactly what is written in error code&lt;BR /&gt;&lt;BR /&gt;When you type:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Document doc = this.ActiveUIDocument.Document;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;you mean, that you want&amp;nbsp;accessing to property "ActiveUIDocument" of "Class1"&lt;BR /&gt;&lt;BR /&gt;However, I can't see property "ActiveUIDocument" in your code snippet. Also "Class1"&amp;nbsp;doesn't inherit from any class, that might contain this property. That's why&amp;nbsp;compiler throws an error.&lt;BR /&gt;&lt;BR /&gt;To avoid this error, modify your code like this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;........
public class Class1
{
    public UIDocument ActiveUIDocument { get; private set; }//define property with private set signature - it means you can't asign property value outside of your class
    public Class1(UIDocument uIDocument)//define constructor
    {
        ActiveUIDocument = uIDocument;//asign value to your property
    }
.........//the rest of the code snippet remains unchanged
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Feb 2022 07:59:49 GMT</pubDate>
    <dc:creator>Hominis06</dc:creator>
    <dc:date>2022-02-09T07:59:49Z</dc:date>
    <item>
      <title>Auto-join between walls and slabs</title>
      <link>https://forums.autodesk.com/t5/revit-bim-360-autodesk/auto-join-between-walls-and-slabs/m-p/9033288#M13137</link>
      <description>&lt;P&gt;Good afternoon, I found this code to join walls and slabs, but when I compile it in C # it makes an error in the code line "Document doc = this.ActiveUIDocument.Document;". I am using the code in visual studio community 2019 and the following error appears in the list of errors&lt;/P&gt;&lt;P&gt;Error "Class1" does not contain a definition for "ActiveUIDocument" or an accessible extension method "ActiveUIDocument" that accepts a first argument of type "Class1".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me and know what the code is missing to be functional and to use it in revit.&lt;BR /&gt;PS: I found the code in an autodesk forum more or less in 2014, I don't know if it has to be updated, I'm new to this topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using System;&lt;BR /&gt;using System.Collections.Generic;&lt;BR /&gt;using System.Linq;&lt;BR /&gt;using System.Text;&lt;BR /&gt;using System.Threading.Tasks;&lt;BR /&gt;using Autodesk.Revit.DB;&lt;BR /&gt;using Autodesk.Revit.UI;&lt;/P&gt;&lt;P&gt;namespace Autojoining_floors_and_walls&lt;BR /&gt;{&lt;BR /&gt;[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]&lt;BR /&gt;public class Class1&lt;BR /&gt;{&lt;BR /&gt;private bool overlap1D(double a1, double a2, double b1, double b2)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;if (a2 &amp;gt;= b1 &amp;amp;&amp;amp; b2 &amp;gt;= a1) return true;&lt;/P&gt;&lt;P&gt;return false;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;private bool bbIntersect(BoundingBoxXYZ A, BoundingBoxXYZ B)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;return overlap1D(A.Min.X, A.Max.X, B.Min.X, B.Max.X) &amp;amp;&amp;amp;&lt;BR /&gt;overlap1D(A.Min.Y, A.Max.Y, B.Min.Y, B.Max.Y) &amp;amp;&amp;amp;&lt;BR /&gt;overlap1D(A.Min.Z, A.Max.Z, B.Min.Z, B.Max.Z);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;public void joinFloorWall()&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;Document doc = this.&lt;STRONG&gt;ActiveUIDocument&lt;/STRONG&gt;.Document;&lt;BR /&gt;UIDocument uiDoc = new UIDocument(doc);&lt;/P&gt;&lt;P&gt;FilteredElementCollector walls = new FilteredElementCollector(doc)&lt;BR /&gt;.OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType();&lt;BR /&gt;FilteredElementCollector floors = new FilteredElementCollector(doc)&lt;BR /&gt;.OfCategory(BuiltInCategory.OST_Floors).WhereElementIsNotElementType();&lt;/P&gt;&lt;P&gt;using (Transaction t = new Transaction(doc, "Join walls to floors"))&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;t.Start();&lt;BR /&gt;foreach (Wall w in walls)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;BoundingBoxXYZ wBB = w.get_BoundingBox(null);&lt;/P&gt;&lt;P&gt;if (wBB != null) foreach (Floor f in floors)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;BoundingBoxXYZ fBB = f.get_BoundingBox(null);&lt;/P&gt;&lt;P&gt;if (fBB != null) if (bbIntersect(wBB, fBB))&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;if (!JoinGeometryUtils.AreElementsJoined(doc, w, f))&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;JoinGeometryUtils.JoinGeometry(doc, w, f);&lt;BR /&gt;}&lt;BR /&gt;catch (Autodesk.Revit.Exceptions.ApplicationException)&lt;BR /&gt;{&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;t.Commit();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 18:34:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-bim-360-autodesk/auto-join-between-walls-and-slabs/m-p/9033288#M13137</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-18T18:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Auto-join between walls and slabs</title>
      <link>https://forums.autodesk.com/t5/revit-bim-360-autodesk/auto-join-between-walls-and-slabs/m-p/10938265#M21377</link>
      <description>&lt;P&gt;Hello&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Error means exactly what is written in error code&lt;BR /&gt;&lt;BR /&gt;When you type:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Document doc = this.ActiveUIDocument.Document;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;you mean, that you want&amp;nbsp;accessing to property "ActiveUIDocument" of "Class1"&lt;BR /&gt;&lt;BR /&gt;However, I can't see property "ActiveUIDocument" in your code snippet. Also "Class1"&amp;nbsp;doesn't inherit from any class, that might contain this property. That's why&amp;nbsp;compiler throws an error.&lt;BR /&gt;&lt;BR /&gt;To avoid this error, modify your code like this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;........
public class Class1
{
    public UIDocument ActiveUIDocument { get; private set; }//define property with private set signature - it means you can't asign property value outside of your class
    public Class1(UIDocument uIDocument)//define constructor
    {
        ActiveUIDocument = uIDocument;//asign value to your property
    }
.........//the rest of the code snippet remains unchanged
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 07:59:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-bim-360-autodesk/auto-join-between-walls-and-slabs/m-p/10938265#M21377</guid>
      <dc:creator>Hominis06</dc:creator>
      <dc:date>2022-02-09T07:59:49Z</dc:date>
    </item>
  </channel>
</rss>

