<?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 Join two structural framings in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984232#M68300</link>
    <description>&lt;P&gt;This error message&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2016 10:05:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-01-12T10:05:39Z</dc:date>
    <item>
      <title>How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984086#M68298</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to join two structural framing..This is the code I had written below but its show error.I attached some screen shoot for this.&lt;/P&gt;&lt;P&gt;plz tell me what mistake that I had done.If possible plz tell the code&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;using Autodesk.Revit.Attributes;&lt;BR /&gt;using Autodesk.Revit.DB;&lt;BR /&gt;using Autodesk.Revit.UI;&lt;/P&gt;&lt;P&gt;namespace JoinGeometry&lt;BR /&gt;{&lt;BR /&gt;[Transaction(TransactionMode.Manual)]&lt;/P&gt;&lt;P&gt;class BBunjoin:IExternalCommand&lt;BR /&gt;{&lt;BR /&gt;public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)&lt;BR /&gt;{&lt;BR /&gt;UIApplication uiApp = commandData.Application;&lt;BR /&gt;UIDocument uidoc = uiApp.ActiveUIDocument;&lt;BR /&gt;Document doc = uidoc.Document;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//--get walls on the active view-----------&lt;/P&gt;&lt;P&gt;FilteredElementCollector beam1 = new FilteredElementCollector(doc, doc.ActiveView.Id);&lt;BR /&gt;beam1.OfClass(typeof(FamilyInstance));&lt;BR /&gt;beam1.OfCategory(BuiltInCategory.OST_StructuralFraming);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foreach (FamilyInstance bem1 in beam1)&lt;BR /&gt;{&lt;BR /&gt;FilteredElementCollector beam2 = new FilteredElementCollector(doc, doc.ActiveView.Id);&lt;/P&gt;&lt;P&gt;beam2.OfClass(typeof(FamilyInstance));&lt;BR /&gt;beam2.OfCategory(BuiltInCategory.OST_StructuralFraming);&lt;BR /&gt;/* BoundingBoxXYZ bb = bem1.get_BoundingBox(doc.ActiveView);&lt;BR /&gt;Outline outline = new Outline(bb.Min, bb.Max);&lt;BR /&gt;BoundingBoxIntersectsFilter bbfilter =&lt;BR /&gt;new BoundingBoxIntersectsFilter(outline);&lt;BR /&gt;beam2.WherePasses(bbfilter);*/&lt;/P&gt;&lt;P&gt;foreach (FamilyInstance bem2 in beam2)&lt;BR /&gt;{&lt;BR /&gt;using (Transaction t = new Transaction(doc, "Join All beam/beam"))&lt;BR /&gt;{&lt;BR /&gt;t.Start();&lt;BR /&gt;JoinGeometryUtils.JoinGeometry(doc, bem1, bem2);&lt;/P&gt;&lt;P&gt;t.Commit();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;return Result.Succeeded;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 08:23:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984086#M68298</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-12T08:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984128#M68299</link>
      <description>&lt;P&gt;can you click on the arrow next to show more detail in the error message and post it?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 08:56:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984128#M68299</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2016-01-12T08:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984232#M68300</link>
      <description>&lt;P&gt;This error message&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 10:05:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984232#M68300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-12T10:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984279#M68301</link>
      <description>&lt;P&gt;I thing your code&amp;nbsp;is trying to Join Beam 1 with Beam 2 , it appears that Beam1 is exactly the same as beam2. which means you are asking revit toin a beam with it self.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just add this line after&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  foreach (FamilyInstance bem2 in beam2)
                {
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;if(bem2.Id == bem1.Id) continue;&lt;/STRONG&gt;&lt;/FONT&gt;
 using (Transaction t = new Transaction(doc, "Join All beam/beam"))
 {
 t.Start();
 JoinGeometryUtils.JoinGeometry(doc, bem1, bem2);
 t.Commit();
 }&lt;/PRE&gt;&lt;P&gt;however this might get you to another error:&lt;/P&gt;&lt;P&gt;if you have 3 beams and you are looping around each to join them, it will come at a time that you are joing an element which is already joined which also will raise an error by Revit "Element is already Joined"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a work around this, is add try and catch to your code should be&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                foreach (FamilyInstance bem2 in beam2)
                {
                  &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;  if (bem2.Id == bem1.Id) continue;&lt;/STRONG&gt;&lt;/FONT&gt;
                    using (Transaction t = new Transaction(doc, "Join All beam/beam"))
                    {

                        t.Start();
                       &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt; try
                        {&lt;/FONT&gt;&lt;/STRONG&gt;
                            JoinGeometryUtils.JoinGeometry(doc, bem1, bem2);
                      &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;  }
                        catch (Autodesk.Revit.Exceptions.ArgumentException)
                        {


                        }&lt;/FONT&gt;&lt;/STRONG&gt;
                        t.Commit();
                    }

                }&lt;/PRE&gt;&lt;P&gt;Give it a try and let us know the results&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 10:48:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984279#M68301</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2016-01-12T10:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984317#M68302</link>
      <description>&lt;P&gt;Thank u for reply, you are right, I added the code which you have given from that the beam has been joined.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 11:14:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5984317#M68302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-12T11:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5986010#M68303</link>
      <description>&lt;P&gt;One more problem occured when I want to SwitchJoin two structural framing it do not switchjoin &amp;nbsp;the structural framing and it does not occur any error.&lt;/P&gt;&lt;P&gt;plz tell me what should I do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THIS IS THE CODE FOR SWITCHJOIN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;/P&gt;&lt;P&gt;using Autodesk.Revit.Attributes;&lt;BR /&gt;using Autodesk.Revit.DB;&lt;BR /&gt;using Autodesk.Revit.UI;&lt;/P&gt;&lt;P&gt;namespace JoinGeometry&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;[Transaction(TransactionMode.Manual)]&lt;/P&gt;&lt;P&gt;class BBswitchjoin:IExternalCommand&lt;BR /&gt;{&lt;BR /&gt;public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)&lt;BR /&gt;{&lt;BR /&gt;UIApplication uiApp = commandData.Application;&lt;BR /&gt;UIDocument uidoc = uiApp.ActiveUIDocument;&lt;BR /&gt;Document doc = uidoc.Document;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//--get beam on the active view-----------&lt;/P&gt;&lt;P&gt;FilteredElementCollector beam1 = new FilteredElementCollector(doc, doc.ActiveView.Id);&lt;BR /&gt;beam1.OfClass(typeof(FamilyInstance));&lt;BR /&gt;beam1.OfCategory(BuiltInCategory.OST_StructuralFraming);&lt;/P&gt;&lt;P&gt;foreach (FamilyInstance bem1 in beam1)&lt;BR /&gt;{&lt;BR /&gt;FilteredElementCollector beam2 = new FilteredElementCollector(doc, doc.ActiveView.Id);&lt;BR /&gt;beam2.OfClass(typeof(FamilyInstance));&lt;BR /&gt;beam2.OfCategory(BuiltInCategory.OST_StructuralFraming);&lt;/P&gt;&lt;P&gt;BoundingBoxXYZ bb = bem1.get_BoundingBox(doc.ActiveView);&lt;BR /&gt;Outline outline = new Outline(bb.Min, bb.Max);&lt;BR /&gt;BoundingBoxIntersectsFilter bbfilter =&lt;BR /&gt;new BoundingBoxIntersectsFilter(outline);&lt;BR /&gt;beam2.WherePasses(bbfilter);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;foreach (FamilyInstance bem2 in beam2)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;if (bem1.Id == bem2.Id) continue;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;using (Transaction t = new Transaction(doc, "Join All beam/beam"))&lt;BR /&gt;{&lt;BR /&gt;t.Start();&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;JoinGeometryUtils.SwitchJoinOrder(doc,bem2,bem1);&lt;BR /&gt;}&lt;BR /&gt;catch (Autodesk.Revit.Exceptions.ArgumentException)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;t.Commit();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;return Result.Succeeded;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 09:08:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5986010#M68303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-13T09:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5986058#M68304</link>
      <description>&lt;P&gt;I am not exactly sure. but try first unjoining then commit transaction and then join&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 09:56:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5986058#M68304</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2016-01-13T09:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5990321#M68305</link>
      <description>&lt;P&gt;It not work.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 08:28:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/5990321#M68305</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-15T08:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/7560549#M68306</link>
      <description>&lt;P&gt;How can I control if there is a warning if 2 elements are not intersected. It can be ignored and continue to the loop with the others?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/428927i252798BD64F6BA30/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 01:03:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/7560549#M68306</guid>
      <dc:creator>Shai.Nguyen</dc:creator>
      <dc:date>2017-11-21T01:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to Join two structural framings</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/7986616#M68307</link>
      <description>&lt;P&gt;I got these issue, How should be do?&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 08:52:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-join-two-structural-framings/m-p/7986616#M68307</guid>
      <dc:creator>thannaingoo.api</dc:creator>
      <dc:date>2018-05-08T08:52:44Z</dc:date>
    </item>
  </channel>
</rss>

