<?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: Retrieving points of top face of a beam in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/9218319#M37707</link>
    <description>&lt;P&gt;Jeremy thanks for replying. I think the face approach might be the long way to get where I want...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually just need the coordinates on top of the beam's four corners. Would there be another method to retrieve these as points(X,Y,Z)?&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="2019-12-24_11-15-11.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/710771i3472E6DEAD50A203/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-12-24_11-15-11.png" alt="2019-12-24_11-15-11.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Dec 2019 08:20:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-12-24T08:20:10Z</dc:date>
    <item>
      <title>Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/9217302#M37705</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to define the top surface plane of a structural beam.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need to retrieve at least 3 points from the top face of a structural beam. However, with the following code, I am stuck.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;FilteredElementCollector collector = new FilteredElementCollector(Global.doc()).WhereElementIsNotElementType().OfCategory(BuiltInCategory.OST_StructuralFraming); // select all structural framing(beams)
List&amp;lt;Element&amp;gt;  beamList = collector.ToList(); // select all structural beams as a List
for (int i = 0; i &amp;lt; allBeamList.Count; i++)
{
                    beamGeo = beamList[i].get_Geometry(geomOptions);
                    foreach (GeometryObject geomObj in beamGeo)
                    {
                        geomSolid = geomObj as Solid;
                        try
                        {
                            foreach (Face geomFace in geomSolid.Faces)
                            {
                                face = geomFace;
                                edges = face.GetEdgesAsCurveLoops();
                                break;
                            }
                        }
                        catch{}
                    }
}&lt;/PRE&gt;&lt;P&gt;From the &lt;STRONG&gt;edges &lt;/STRONG&gt;following info is got but I couldn't make sense of any of them. Any help is much appreciated!&lt;/P&gt;&lt;P&gt;- [Autodesk.Revit.DB.Line] {Autodesk.Revit.DB.Line} Autodesk.Revit.DB.Line&lt;BR /&gt;+ Direction {(0.883461516, -0.468503734, 0.000000000)} Autodesk.Revit.DB.XYZ&lt;BR /&gt;+ Origin {(41.600096955, 43.315422219, 0.984251969)} Autodesk.Revit.DB.XYZ&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 14:26:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/9217302#M37705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-23T14:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/9217902#M37706</link>
      <description>&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2009/08/bottom-face-of-a-wall.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2009/08/bottom-face-of-a-wall.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 22:57:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/9217902#M37706</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-12-23T22:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/9218319#M37707</link>
      <description>&lt;P&gt;Jeremy thanks for replying. I think the face approach might be the long way to get where I want...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually just need the coordinates on top of the beam's four corners. Would there be another method to retrieve these as points(X,Y,Z)?&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="2019-12-24_11-15-11.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/710771i3472E6DEAD50A203/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-12-24_11-15-11.png" alt="2019-12-24_11-15-11.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 08:20:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/9218319#M37707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-24T08:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/9218486#M37708</link>
      <description>&lt;P&gt;1st you need to only select the faces that points towards +Z (to get the inclined and the horizantal top faces)&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;if (face.ComputeNormal(new UV(.5,.5)).Z &amp;gt; 0)&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;by then you will be able to get the only top Faces.&lt;/P&gt;&lt;P&gt;then after loop through the faces --&amp;gt; edges (like in your example)&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;PRE&gt;edges = face.GetEdgesAsCurveLoops();&lt;BR /&gt;foreach (var edge in edges)&lt;BR /&gt;{&lt;BR /&gt;XYZ topBeamPoint = edge .AsCurve().GetEndPoint(0); //this is the start point of an edge&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;now you can collect all the top beam points and do you math.&lt;/P&gt;&lt;P&gt;hope that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 10:56:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/9218486#M37708</guid>
      <dc:creator>Moustafa_K</dc:creator>
      <dc:date>2019-12-24T10:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/10452818#M37709</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;Did you have the corrected code for this? I am tryin to do something similar and it would be a great starting point.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 13:34:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/10452818#M37709</guid>
      <dc:creator>zrodgersTSSSU</dc:creator>
      <dc:date>2021-07-08T13:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/10453687#M37710</link>
      <description>&lt;P&gt;The proper way to retrieve the top face of the beam is to retrieve the beam solid, query it for its faces and pick the one whose normal vector points upwards. From that face, you can retrieve the corner vertices or any other point you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another approach that will probably achieve what is asked for here is to retrieve all the beam solid's vertices and pick the three with the largest Z coordinate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both of these approaches are illustrated by The Building Coder in numerous different examples, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2011/07/top-faces-of-wall.html" target="_blank" rel="noopener"&gt;Top Faces of Sloped Wall&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2011/12/top-faces-of-sloped-wall-update.html" target="_blank" rel="noopener"&gt;Top Faces of Sloped Wall Update&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2012/06/real-world-concrete-corner-coordinates.html" target="_blank" rel="noopener"&gt;Real-World Concrete Corner Coordinates&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 19:20:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/10453687#M37710</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-07-08T19:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/10453795#M37711</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;Thanks for the response. I was trying to get a starting point but ended up writing it out anyways.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was how i got the top and bottom, had to do some funky stuff to get the faces I wanted depending on beam angle. but it worked out.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;foreach (GeometryObject o in instGeoElem)
                                        {
                                            Solid solid = o as Solid;
                                            if (solid != null)
                                            {
                                                foreach (Face geoFace in solid.Faces)
                                                {
                                                    //filters top size faces//
                                                    double faceTZ = geoFace.ComputeNormal(new UV(0.5, 0.5)).Z;

                                                    //gets top faces
                                                    if (faceTZ &amp;gt; 0.0)
                                                    {
                                                        if (faceTZ &amp;gt;= maxZ)
                                                        {
                                                            maxZ = faceTZ;
                                                            maxFaces.Add(geoFace);
                                                            //get largerst top face
                                                            foreach(Face f in maxFaces)
                                                            {
                                                                if (f.Area &amp;gt; topLargestArea)
                                                                {
                                                                    topLargestArea = f.Area;
                                                                    largestTopFace = f;
                                                                    topNormal = f.ComputeNormal(new UV(0.5, 0.5));
                                                                }

                                                            }
                                                            
                                                        }

                                                    }
                                                    else
                                                    {
                                                        double faceBZ = geoFace.ComputeNormal(new UV(0.5, 0.5)).Z;

                                                        //filters bottom size faces
                                                        if (faceBZ &amp;lt; 0.0)
                                                        {
                                                            if(faceBZ &amp;lt;= minZ)
                                                            {
                                                                minZ = faceBZ;
                                                                minFaces.Add(geoFace);
                                                                foreach(Face f in minFaces)
                                                                {
                                                                    //get largerst top face
                                                                    if (f.Area &amp;gt; bottomLargestArea)
                                                                    {
                                                                        bottomLargestArea = f.Area;
                                                                        largestBottomFace = f;
                                                                        bottomNormal = f.ComputeNormal(new UV(0.5, 0.5));
                                                                    }

                                                                }
                                                            }
                                                            
                                                        }
                                                    }
                                                }
                                            }
                                        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 19:59:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/10453795#M37711</guid>
      <dc:creator>zrodgersTSSSU</dc:creator>
      <dc:date>2021-07-08T19:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11479378#M37712</link>
      <description>&lt;P&gt;Hello i want to place an object (Generic model) on the face of a beam ! can u guide me how to do that . its my first time doing this.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 07:29:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11479378#M37712</guid>
      <dc:creator>Houba3314</dc:creator>
      <dc:date>2022-10-13T07:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11480159#M37713</link>
      <description>&lt;P&gt;I suggest starting by studying this description of my early exploration into a very similar task in 2010:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2010/01/spot-elevation-creation-on-top-of-beam.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2010/01/spot-elevation-creation-on-top-of-beam.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 13:43:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11480159#M37713</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-10-13T13:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11480704#M37714</link>
      <description>&lt;P&gt;The symbol position is laid out as in the family template it is then transformed to the instance position via the instance transform. That process can also be reversed via inverse of instance transform.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 17:19:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11480704#M37714</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2022-10-13T17:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11482118#M37715</link>
      <description>&lt;P&gt;hello again, i am able to find the faces of the beam and get intersection beween a beam and a duct now i want to place and element at that intersection . when i use doc.create.newfamilyinstance i cant use it wiht reference as a parameter because beam is not a host object&amp;nbsp; i tried it other overload and it did create it but not on the same level (height) i dont know the technical word im sorry i mostly do web dev so this is new to me .&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 10:50:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11482118#M37715</guid>
      <dc:creator>Houba3314</dc:creator>
      <dc:date>2023-01-09T10:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving points of top face of a beam</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11482175#M37716</link>
      <description>&lt;P&gt;Sorry i didnt understand you can you provide a code or something&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 08:02:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/retrieving-points-of-top-face-of-a-beam/m-p/11482175#M37716</guid>
      <dc:creator>Houba3314</dc:creator>
      <dc:date>2022-10-14T08:02:52Z</dc:date>
    </item>
  </channel>
</rss>

