<?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: Automatically count total number of holes and display in a note in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11437388#M66015</link>
    <description>&lt;P&gt;Hi! Please share the exact files you are working on here. It is possible there could be syntax errors in your rule.&lt;/P&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2022 22:40:43 GMT</pubDate>
    <dc:creator>johnsonshiue</dc:creator>
    <dc:date>2022-09-21T22:40:43Z</dc:date>
    <item>
      <title>Automatically count total number of holes and display in a note</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11426173#M66010</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to automatically count the total number of holes on a part and display it in a note on a drawing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This note is used by production as a quick check to see if all holes were drilled on a part. For instance, if there are 36 different holes on a part, they will count all the holes and check if the number corresponds to the note.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 14:05:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11426173#M66010</guid>
      <dc:creator>Yves_B</dc:creator>
      <dc:date>2022-09-16T14:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically count total number of holes and display in a note</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11426258#M66011</link>
      <description>&lt;P&gt;Hole Table will list all the hole.&lt;/P&gt;&lt;P&gt;Hole Note might count most of the holes&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 14:20:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11426258#M66011</guid>
      <dc:creator>Frederick_Law</dc:creator>
      <dc:date>2022-09-16T14:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically count total number of holes and display in a note</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11426431#M66012</link>
      <description>&lt;P&gt;There are a number of iLogic routines available which may do this or can be modified to suit your needs. Here's one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/AlexFielder/iLogic/blob/master/Modelling/GetHoleCountAndDiameters.iLogicVb" target="_blank"&gt;https://github.com/AlexFielder/iLogic/blob/master/Modelling/GetHoleCountAndDiameters.iLogicVb&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Caveat: I have not tried it, so cannot verify it functions correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 15:23:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11426431#M66012</guid>
      <dc:creator>b.mccarthy</dc:creator>
      <dc:date>2022-09-16T15:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically count total number of holes and display in a note</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11434774#M66013</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got around to testing this, however, I could not get it to run in IV2023. iLogic gives this error when running the code as is (name changed to protect the innocent...):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error 1.jpg" style="width: 329px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1118494i9B496E40AF10D54A/image-dimensions/329x200?v=v2" width="329" height="200" role="button" title="Error 1.jpg" alt="Error 1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding the code defined above generates this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error 2.jpg" style="width: 515px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1118495i8237BA94794125C0/image-dimensions/515x313?v=v2" width="515" height="313" role="button" title="Error 2.jpg" alt="Error 2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not a coder, so I do not know where to go from here. Sent a note to the author but have not heard back. My apologies for not vetting prior to posting...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone get this to work?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 23:41:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11434774#M66013</guid>
      <dc:creator>b.mccarthy</dc:creator>
      <dc:date>2022-09-20T23:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically count total number of holes and display in a note</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11437153#M66014</link>
      <description>Thanks for trying the code. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 21 Sep 2022 20:15:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11437153#M66014</guid>
      <dc:creator>Yves_B</dc:creator>
      <dc:date>2022-09-21T20:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically count total number of holes and display in a note</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11437388#M66015</link>
      <description>&lt;P&gt;Hi! Please share the exact files you are working on here. It is possible there could be syntax errors in your rule.&lt;/P&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 22:40:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11437388#M66015</guid>
      <dc:creator>johnsonshiue</dc:creator>
      <dc:date>2022-09-21T22:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically count total number of holes and display in a note</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11442380#M66016</link>
      <description>&lt;P&gt;From the link I provided above:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Function _GetHoleCountAndDiameters(oPartDoc As PartDocument) As Double(,)
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	Dim oTO As TransientObjects = ThisApplication.TransientObjects
	Dim oPartDef As PartComponentDefinition = oPartDoc.ComponentDefinition
	Dim oSizes As New List(Of Double)()
	Dim oLines As ObjectCollection = oTO.CreateObjectCollection
	Dim oTestLine As Line
	Dim oIsExisting As Boolean
	For Each oFace As Face In oPartDef.SurfaceBodies.Item(1).Faces
		If oFace.SurfaceType = 5891 Then
			oTestLine = oTG.CreateLine(oFace.Geometry.BasePoint,oFace.Geometry.AxisVector.AsVector)
			oIsExisting = False
			For Each oLine As Line In oLines
				If oLine.IsColinearTo(oTestLine) Then oIsExisting = True			
			Next
			If Not oIsExisting Then
				oLines.Add(oTestLine)
				oSizes.Add(oFace.Geometry.Radius*2)
			End If
		End If
	Next
	Dim oUniqueSizeList As New List(Of Double)()
	For Each oSize As Double In oSizes
		If Not oUniqueSizeList.Contains(oSize) Then oUniqueSizeList.Add(oSize)	
	Next
	oUniqueSizeList.Sort
	Dim oHoles(oUniqueSizeList.Count-1,1) As Double
	For i As Integer = 0 To oUniqueSizeList.Count-1
		oHoles(i,0) = oUniqueSizeList.Item(i)
		oHoles(i,1) = 0
	Next
	For Each oSize As Double In oSizes
		oHoles(oUniqueSizeList.IndexOf(oSize),1) = oHoles(oUniqueSizeList.IndexOf(oSize),1) + 1
	Next
	Return oHoles
End Function&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I heard back from the author, who states:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;"This rule is simply a function I added to this library as per the forum post linked in the og commit message. It needs Sub Main End Sub added at the top, but also needs to&amp;nbsp;do&amp;nbsp;something with the resultant count. If you look at the&amp;nbsp;&lt;A href="https://github.com/AlexFielder/iLogic/blob/master/Modelling/FEATURECOUNT.iLogicVb" target="_blank" rel="noopener"&gt;https://github.com/AlexFielder/iLogic/blob/master/Modelling/FEATURECOUNT.iLogicVb&lt;/A&gt;&amp;nbsp;rule it shows a way of using the data."&lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added the Sub Main End Sub as he indicates, but I still could not get it to run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 22:52:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11442380#M66016</guid>
      <dc:creator>b.mccarthy</dc:creator>
      <dc:date>2022-09-23T22:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically count total number of holes and display in a note</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11445879#M66017</link>
      <description>&lt;P&gt;Well, thanks for trying &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 15:11:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/automatically-count-total-number-of-holes-and-display-in-a-note/m-p/11445879#M66017</guid>
      <dc:creator>Yves_B</dc:creator>
      <dc:date>2022-09-26T15:11:51Z</dc:date>
    </item>
  </channel>
</rss>

