<?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: Most efficient API way to count solid body's faces in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8733191#M76861</link>
    <description>&lt;P&gt;Think you are right with that..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could it be possible that this kind of information is directly stored in the document anywhere!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2019 08:40:52 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2019-04-16T08:40:52Z</dc:date>
    <item>
      <title>Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8729037#M76854</link>
      <description>&lt;P&gt;I'd like to know which is the fastest way to count solid body's faces.&lt;/P&gt;
&lt;P&gt;Please find the IPT with quite a few (23000+ faces) attached.&lt;/P&gt;
&lt;P&gt;Apart from geometry it has an iLogic rule embedded that tries to access the face counter using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ThisDoc.Document.ComponentDefinition.SurfaceBodies(1).Faces.Count&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main problem with the rule - it takes about 10 seconds to get the counter value (which is unacceptably long).&lt;/P&gt;
&lt;P&gt;Another (manual) way to count not only faces but all objects is to run BSCT (Ctrl+F7) which takes less than 2 seconds...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Apr 2019 08:44:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8729037#M76854</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2019-04-14T08:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8730479#M76855</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/572109"&gt;@Maxim-CADman77&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, Inventor API does not have capability like BSCT (CTRL + F7). Please log this wish list at idea station using below link.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 10:00:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8730479#M76855</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2019-04-15T10:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8730485#M76856</link>
      <description>Thank you for suggestion but I need some solution that I can apply just nowadays (not several years later).&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Apr 2019 10:02:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8730485#M76856</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2019-04-15T10:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8730577#M76857</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use this instead:&lt;/P&gt;
&lt;PRE&gt;Dim CmdMan As ControlDefinition
    CmdMan = ThisApplication.CommandManager.ControlDefinitions.Item("AppBodySanityCheckCmd")
   	
	CmdMan.Execute
    	' or CmdMan.Execute2 (True)&lt;/PRE&gt;
&lt;P&gt;it is the same as CTRl+F7&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 10:45:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8730577#M76857</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-04-15T10:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8732843#M76858</link>
      <description>Thank you.&lt;BR /&gt;This works but AFAIK returns no data at the API level (only at UI level).&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Apr 2019 05:21:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8732843#M76858</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2019-04-16T05:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8732999#M76859</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think Autodesk uses "ApprenticeServer" for this!!&lt;/P&gt;
&lt;P&gt;This runs quicker.&lt;/P&gt;
&lt;PRE&gt;Dim a As ApprenticeServer = New ApprenticeServerComponent

        Dim b As ApprenticeServerDocument = a.Open("C:\YOURFILENAME.ipt")
        MsgBox(b.ComponentDefinition.SurfaceBodies(1).Faces.Count)&lt;/PRE&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 06:56:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8732999#M76859</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-04-16T06:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8733160#M76860</link>
      <description>ApprenticeServer takes even longer (about 17 seconds) to get the first solid body faces count of the sample &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Apr 2019 08:24:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8733160#M76860</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2019-04-16T08:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8733191#M76861</link>
      <description>&lt;P&gt;Think you are right with that..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could it be possible that this kind of information is directly stored in the document anywhere!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 08:40:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/8733191#M76861</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-04-16T08:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/9401638#M76862</link>
      <description>&lt;P&gt;8-second duration difference is not a big deal but recently one of IPTs stored in our corporate vault taked 16minutes to read the counter of 103000+ faces (while BSCT get it done in less than 2 minutes). Quarter of hour seems worth to re-activate the workaround&amp;nbsp; for this issue... Any further suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 12:12:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/9401638#M76862</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2020-03-26T12:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/9401961#M76863</link>
      <description>&lt;P&gt;So I did a quick test that reveals something interesting -- the operation that takes so long isn't actually getting the Count property, it's getting the Faces collection. In other words, this is very slow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;faceColl&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Faces&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;SurfaceBodies&lt;/SPAN&gt;(1).&lt;SPAN&gt;Faces&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this is very fast:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;FC&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Integer&lt;/SPAN&gt; = &lt;SPAN&gt;faceColl&lt;/SPAN&gt;.&lt;SPAN&gt;Count&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So counting isn't the issue, the issue is generating the collection of thousands of faces. Doesn't exactly help you... but it at least explains why it's so much slower than BSCT. The BSCT just counts the faces, whereas the SurfaceBody.Faces property has to generate a runtime collection of thousands of Face objects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be handy to have a "SurfaceBody.Inspect" object that offers properties like "FaceCount", "EdgeCount", etc., so we can query these attributes without having to generate the "Faces", "Edges", etc. collections. Maybe something for the IdeaStation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime... the question is how to determine how many faces there are without using the "SurfaceBody.Faces" property. I tried to search the API documentation for some kind of API mechanism for "inspecting" surface bodies but I'm not seeing anything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/572109"&gt;@Maxim-CADman77&lt;/a&gt;, assuming BSCT is the only quick way to get a face count right now, would it be acceptable if there were some automated way to open, read, parse, and get the face count from the BSCT window? The main drawback to this is the file has to be open on-screen for it to work. Is that a deal breaker or could that be a possible solution?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 14:42:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/9401961#M76863</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2020-03-26T14:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Most efficient API way to count solid body's faces</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/9402424#M76864</link>
      <description>&lt;P&gt;Yes, my project supposes document opening thus parsing BSCT-report seems the only possible workaround for the current state of Inventor's API...&lt;BR /&gt;Its pitty I'm not yet good enough in parsing.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 17:24:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/most-efficient-api-way-to-count-solid-body-s-faces/m-p/9402424#M76864</guid>
      <dc:creator>Maxim-CADman77</dc:creator>
      <dc:date>2020-03-26T17:24:45Z</dc:date>
    </item>
  </channel>
</rss>

