<?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 get polygon count of the project ?  (use freeware MS &amp;quot;3D Viewer&amp;amp; in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/10539321#M48695</link>
    <description>&lt;P&gt;Thank you for confirming that it works fine for you with no additional filtering.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe the two default levels in my 3D view are contributing something. I'll remove those and try again &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;</description>
    <pubDate>Thu, 12 Aug 2021 06:07:55 GMT</pubDate>
    <dc:creator>jeremy_tammik</dc:creator>
    <dc:date>2021-08-12T06:07:55Z</dc:date>
    <item>
      <title>How to get polygon count of the project ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/8135547#M48688</link>
      <description>&lt;P&gt;I am exporting the model into obj format. I want to know if it is possible to the polygon count or the number of triangles in the model before export. Does Revit provide any API ? Can I count the polygon for a element and then add them all.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 14:36:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/8135547#M48688</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-17T14:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get polygon count of the project ?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/8136052#M48689</link>
      <description>&lt;P&gt;No, no such API is provided ready-built.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, sure you can retrieve all the element geometry, tessellate it, and sum up the total number of triangles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might find it easiest to do so using&amp;nbsp;a custom exporter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.1" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 17:18:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/8136052#M48689</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-07-17T17:18:42Z</dc:date>
    </item>
    <item>
      <title>How to get polygon count of the project ?  (use freeware MS "3D Viewer")</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/8586139#M48690</link>
      <description>&lt;P&gt;Export your Revit project (.rvt) or family (.rfa) file to FBX format.&amp;nbsp; In Revit, go to File &amp;gt; Export &amp;gt; FBX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Open the FBX file in Microsoft &lt;U&gt;3D Viewer&lt;/U&gt;.&amp;nbsp; Depending on the file size, it may take a little while to open.&amp;nbsp; A spinning 3D box icon will indicate loading is in progress.&lt;/P&gt;
&lt;P&gt;In the viewer, go to Tools and click on "Stats &amp;amp; Shading".&amp;nbsp; It will list the number of triangles and vertices.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 3D Viewer is a free download if you don't already have it in Windows 10.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 21:04:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/8586139#M48690</guid>
      <dc:creator>Homsey-CCH</dc:creator>
      <dc:date>2019-02-10T21:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get polygon count of the project ?  (use freeware MS "3D Viewer&amp;</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/8586154#M48691</link>
      <description>&lt;P&gt;Thank you for a non-programmer's answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result should be the same as in using the custom exporter in the Revit API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 21:15:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/8586154#M48691</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-02-10T21:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get polygon count of the project ?  (use freeware MS "3D Viewer&amp;</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/10530975#M48692</link>
      <description>&lt;P&gt;Here is the code&lt;/P&gt;&lt;LI-CODE lang="general"&gt;class ProfileExport : IExportContext
    {
        private Document document;

        private Func&amp;lt;bool&amp;gt; isCanceled;

        private Action&amp;lt;long, int&amp;gt; callback;

        private long numTriangles;

        private List&amp;lt;ElementId&amp;gt; materialIds;

        private bool includeMaterials = true;

        public ProfileExport(Document document, Func&amp;lt;bool&amp;gt; isCanceled, Action&amp;lt;long, int&amp;gt; callback)
        {
            this.isCanceled = isCanceled;
            this.callback = callback;
            this.document = document;
            this.materialIds = new List&amp;lt;ElementId&amp;gt;();
        }

        public void OnPolymesh(PolymeshTopology polymesh)
        {
            this.numTriangles += (long)polymesh.NumberOfFacets;
        }

        public void Finish()
        {
            this.callback(this.numTriangles, this.materialIds.Count);
        }

        public bool IsCanceled()
        {
            return false;
        }

        public bool Start()
        {
            this.materialIds = new List&amp;lt;ElementId&amp;gt;();
            return true;
        }

        public void OnRPC(RPCNode node)
        {
        }

        public void OnLight(LightNode node)
        {
        }

        public RenderNodeAction OnViewBegin(ViewNode node)
        {
            node.LevelOfDetail = 8;
            return 0;
        }

        public void OnViewEnd(ElementId elementId)
        {
        }

        public RenderNodeAction OnFaceBegin(FaceNode node)
        {
            return 0;
        }

        public void OnFaceEnd(FaceNode node)
        {
        }

        public RenderNodeAction OnElementBegin(ElementId elementId)
        {
            return 0;
        }

        public void OnElementEnd(ElementId elementId)
        {
        }

        public RenderNodeAction OnInstanceBegin(InstanceNode node)
        {
            return 0;
        }

        public void OnInstanceEnd(InstanceNode node)
        {
        }

        public RenderNodeAction OnLinkBegin(LinkNode node)
        {
            return 0;
        }

        public void OnLinkEnd(LinkNode node)
        {
        }

        public void OnMaterial(MaterialNode node)
        {
            if (this.includeMaterials)
            {
                if (node.MaterialId == ElementId.InvalidElementId)
                {
                    return;
                }
                if (this.materialIds.Contains(node.MaterialId))
                {
                    return;
                }
                this.materialIds.Add(node.MaterialId);
            }
        }
    }&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Aug 2021 12:04:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/10530975#M48692</guid>
      <dc:creator>techXMKH9</dc:creator>
      <dc:date>2021-08-09T12:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get polygon count of the project ?  (use freeware MS "3D Viewer&amp;</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/10533770#M48693</link>
      <description>&lt;P&gt;Thank you for the nice succinct sample!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added it to The Building Coder samples in a new external command&amp;nbsp;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdTriangleCount.cs" target="_blank"&gt;CmdTriangleCount:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples" target="_blank"&gt;https://github.com/jeremytammik/the_building_coder_samples&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdTriangleCount.cs" target="_blank"&gt;https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/BuildingCoder/CmdTriangleCount.cs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tested it in a model with a single wall element with six rectangular faces, i.e., 12 triangles:&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-center" image-alt="tbc_samples_triangle_count.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/950684i3FE860F699B48F1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tbc_samples_triangle_count.png" alt="tbc_samples_triangle_count.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see, it reports 36 faces found. Where might the 24 unexpected ones be coming from?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&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;</description>
      <pubDate>Tue, 10 Aug 2021 11:20:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/10533770#M48693</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-08-10T11:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get polygon count of the project ?  (use freeware MS "3D Viewer&amp;</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/10539294#M48694</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;I do not know why you are getting that. Maybe some hidden elements.&lt;/P&gt;&lt;P&gt;On my end&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="techXMKH9_0-1628747423624.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/951756i03D4BB9A0BA9A032/image-size/medium?v=v2&amp;amp;px=400" role="button" title="techXMKH9_0-1628747423624.png" alt="techXMKH9_0-1628747423624.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 05:50:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/10539294#M48694</guid>
      <dc:creator>techXMKH9</dc:creator>
      <dc:date>2021-08-12T05:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get polygon count of the project ?  (use freeware MS "3D Viewer&amp;</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/10539321#M48695</link>
      <description>&lt;P&gt;Thank you for confirming that it works fine for you with no additional filtering.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe the two default levels in my 3D view are contributing something. I'll remove those and try again &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;</description>
      <pubDate>Thu, 12 Aug 2021 06:07:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-polygon-count-of-the-project/m-p/10539321#M48695</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2021-08-12T06:07:55Z</dc:date>
    </item>
  </channel>
</rss>

