<?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: setting fastener size using API in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-fastener-size-using-api/m-p/9139422#M102994</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5380016"&gt;@mostafamahmoudseddek94&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;how Can I know that I need to construct a new clearance info.!!&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Let's Google!!&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.google.com/search?q=HoleClearanceInfo+inventor" target="_blank" rel="noopener"&gt;https://www.google.com/search?q=HoleClearanceInfo+inventor&lt;/A&gt;&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="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/696766i82CB67BB72B3C38E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or ask in this forum!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freeradical.jp" target="_blank" rel="noopener"&gt;Freeradical&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2019 14:58:46 GMT</pubDate>
    <dc:creator>HideoYamada</dc:creator>
    <dc:date>2019-11-11T14:58:46Z</dc:date>
    <item>
      <title>setting fastener size using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-fastener-size-using-api/m-p/9137835#M102967</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub main()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oHoleF As HoleFeatures
Set oHoleF = oDoc.ComponentDefinition.Features.HoleFeatures


oHoleF.Item(3).ClearanceInfo.FastenerSize = "M10"
    MsgBox (oHoleF.Item(3).ClearanceInfo.FastenerType)&lt;/PRE&gt;&lt;P&gt;Hello, I am new to the API&amp;nbsp;&lt;/P&gt;&lt;P&gt;through this code, I am trying to set the fastener size to be a specific value based on a specific parameter. the programming/API Help informed that the "FastenerSize" is a read-write property to set or get the fastener size so how can I use this method to set the fastener size, Although using this code introduces error for me&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;" Run-time error 445, Object doesn't support this action".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;noting that this is the only thing in the hole feature that will change as shown in the figure below and all other choices will be constant with a different configuration of the model.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capturerr.PNG" style="width: 269px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/696453i147A7ECD5A9545CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capturerr.PNG" alt="Capturerr.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2019 13:30:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-fastener-size-using-api/m-p/9137835#M102967</guid>
      <dc:creator>mostafamahmoudseddek94</dc:creator>
      <dc:date>2019-11-10T13:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: setting fastener size using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-fastener-size-using-api/m-p/9137925#M102968</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to create new HoleClearanceInfo and then replace target ClearanceInfo with new one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub main()
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oHoleF As HoleFeatures
    Set oHoleF = oDoc.ComponentDefinition.Features.HoleFeatures
    
    Dim oHole As HoleFeature
    Set oHole = oHoleF.Item(3)
    
    Dim oOriginal As HoleClearanceInfo
    Set oOriginal = oHole.ClearanceInfo
    
    Dim oChanged As HoleClearanceInfo
    Set oChanged = oHoleF.CreateClearanceInfo(oOriginal.FastenerStandard, oOriginal.FastenerType, "M10", oOriginal.FastenerFitType)
    oHole.ClearanceInfo = oChanged
    MsgBox (oHoleF.Item(1).ClearanceInfo.FastenerType)
End Sub&lt;/PRE&gt;&lt;P&gt;See also :&lt;/P&gt;&lt;P&gt;&lt;A href="https://modthemachine.typepad.com/my_weblog/2019/07/new-apis-in-inventor-20201.html" target="_blank" rel="noopener"&gt;https://modthemachine.typepad.com/my_weblog/2019/07/new-apis-in-inventor-20201.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ah, it is written in the above blog that this API is added to Inventor 2020.1.&lt;/P&gt;&lt;P&gt;If you use Inventor 2019, it will be difficult to change the parameter...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freeradical.jp" target="_blank" rel="noopener"&gt;Freeradical&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2019 16:12:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-fastener-size-using-api/m-p/9137925#M102968</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-11-10T16:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: setting fastener size using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-fastener-size-using-api/m-p/9138796#M102975</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your code.&lt;/P&gt;&lt;P&gt;yes&lt;SPAN style="font-family: inherit;"&gt;, you are right!!, the code did not run.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But for beginner person like me, how Can I know that I need to construct a new clearance info.!!, I mean I did searching in the Inventor Programming help and no indication for this also, I used Watch window too and the type of massage error has no information.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 09:31:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-fastener-size-using-api/m-p/9138796#M102975</guid>
      <dc:creator>mostafamahmoudseddek94</dc:creator>
      <dc:date>2019-11-11T09:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: setting fastener size using API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-fastener-size-using-api/m-p/9139422#M102994</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5380016"&gt;@mostafamahmoudseddek94&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;how Can I know that I need to construct a new clearance info.!!&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Let's Google!!&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.google.com/search?q=HoleClearanceInfo+inventor" target="_blank" rel="noopener"&gt;https://www.google.com/search?q=HoleClearanceInfo+inventor&lt;/A&gt;&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="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/696766i82CB67BB72B3C38E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or ask in this forum!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freeradical.jp" target="_blank" rel="noopener"&gt;Freeradical&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 14:58:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-fastener-size-using-api/m-p/9139422#M102994</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-11-11T14:58:46Z</dc:date>
    </item>
  </channel>
</rss>

