<?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: Insert specific size fastener from Content Center using VB.NET in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328128#M2157</link>
    <description>&lt;P&gt;Sorry, I was mistaken about using .ContentIdentifier and your earlier row number. It should take a TableRow(14), 14, or TableRow(14).InternalName. Regardless, where you add an occurrence, it needs to be to the ComponentDefinition, not the Document object.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2025 15:30:30 GMT</pubDate>
    <dc:creator>jjstr8</dc:creator>
    <dc:date>2025-02-19T15:30:30Z</dc:date>
    <item>
      <title>Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13325442#M2150</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to insert a fastener from Content Center, and the conditions will determine the size that is needed.&lt;/P&gt;&lt;P&gt;I was able to use the code in the API help to place all members of a family but I need to narrow that down.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    Public Sub InsertPEMNuts()
        'Dim oAsmDoc As AssemblyDocument
        'oAsmDoc = ThisApplication.ActiveDocument

        Dim oContentCenter As ContentCenter
        oContentCenter = g_inventorApplication.ContentCenter

        Dim oContentNode As ContentTreeViewNode
        oContentNode = oContentCenter.TreeViewTopNode.ChildNodes.Item("Fasteners").ChildNodes.Item("Bolts").ChildNodes.Item("Hex Head")

        Dim oFamily As ContentFamily
        For Each oFamily In oContentNode.Families
            If oFamily.DisplayName = "ISO 4015" Then
                Exit For
            End If
        Next

        ' Create a NameValueMap to specify parameters (e.g., length, diameter)
        Dim oParams As NameValueMap
        oParams = g_inventorApplication.TransientObjects.CreateNameValueMap
        oParams.Add("NND", 5) ' Set length to 50 mm
        oParams.Add("NLG", 35)


        ' Create the member
        Dim failureReason As MemberManagerErrorsEnum
        Dim failureMessage As String
        Dim oMemberDoc As Document
        oMemberDoc = oFamily.CreateMember(oParams, failureReason, failureMessage, ContentMemberRefreshEnum.kRefreshOutOfDateParts)

        ' Insert the member into the assembly
        Dim oMatrix As Matrix
        oMatrix = g_inventorApplication.TransientGeometry.CreateMatrix

        Dim oOcc As ComponentOccurrence
        oOcc = oDoc.ComponentDefinition.Occurrences.Add(oMemberDoc.FullFileName, oMatrix)
    End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that I need to specify the row. I don't know how to determine the row from the information that I have.&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="J_Dumont_0-1739882482021.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1468171i316661B698C07BDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="J_Dumont_0-1739882482021.png" alt="J_Dumont_0-1739882482021.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's my error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="J_Dumont_1-1739882519064.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1468174i321DBB34920F7333/image-size/medium?v=v2&amp;amp;px=400" role="button" title="J_Dumont_1-1739882519064.png" alt="J_Dumont_1-1739882519064.png" /&gt;&lt;/span&gt;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 12:44:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13325442#M2150</guid>
      <dc:creator>J_Dumont</dc:creator>
      <dc:date>2025-02-18T12:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13326514#M2151</link>
      <description>&lt;P&gt;You're correct that you need to specify a row (or ContentIdentifier string) when calling .CreateMember. I'm not seeing anything built in to narrow it down to your NND &amp;amp; NLG values through the ContentFamily type. It looks like you'll have to loop through oFamily.TableRows and look for a match. Fortunately, you don't have to loop through all columns. The indexer in TableRow does takes a column name string, i.e. oFamily.TableRows(1).Item("NND") will return the column with its InternalName&amp;nbsp; = "NND".&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 22:28:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13326514#M2151</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2025-02-18T22:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13327446#M2152</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/111000"&gt;@jjstr8&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I will only need two separate families and just a few sizes of each, so I can use the row method. In this example, I determined which row I needed, and it failed. Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is updated code.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    Public Sub InsertPEMNuts()
        Dim oAsmDoc As AssemblyDocument
        oAsmDoc = g_inventorApplication.ActiveDocument

        Dim oContentCenter As ContentCenter
        oContentCenter = g_inventorApplication.ContentCenter

        Dim oContentNode As ContentTreeViewNode
        oContentNode = oContentCenter.TreeViewTopNode.ChildNodes.Item("Sheet Metal").ChildNodes.Item("Nuts")

        Dim oFamily As ContentFamily
        For Each oFamily In oContentNode.Families
            If oFamily.DisplayName = "PEM Self-Clinching Nuts S,SS,CLS,CLSS - Inch" Then
                Exit For
            Else
                MsgBox("Family not found")
            End If
        Next

        If Not oFamily Is Nothing Then
            Dim failureReason As MemberManagerErrorsEnum
            Dim failureMessage As String
            Dim memberFilename As String
            memberFilename = oFamily.CreateMember(14, failureReason, failureMessage, ContentMemberRefreshEnum.kDoNotRefreshOutOfDateParts)
            ' Place the part into the assembly.
            Dim transMatrix As Matrix
            transMatrix = g_inventorApplication.TransientGeometry.CreateMatrix
            'transMatrix.Cell(2, 4) = 0
            Dim Occ As ComponentOccurrence
            Occ = oAsmDoc.Occurrences.Add(memberFilename, transMatrix)
        End If
&lt;/LI-CODE&gt;&lt;P&gt;Here is the error&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="J_Dumont_0-1739961870710.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1468593iC0D89CD2D191A9B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="J_Dumont_0-1739961870710.png" alt="J_Dumont_0-1739961870710.png" /&gt;&lt;/span&gt;&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>Wed, 19 Feb 2025 10:46:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13327446#M2152</guid>
      <dc:creator>J_Dumont</dc:creator>
      <dc:date>2025-02-19T10:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13327888#M2153</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/533605"&gt;@J_Dumont&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I too wanted to learn how to insert Content Center parts using VB.NET.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you provide an example of the NND and NLG you want to place?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I found this source code, which originally inserted all the parts of a family.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-57915C88-FF59-4ED6-9A67-47E55DD62639" target="_blank" rel="noopener"&gt;Place Content Center Parts API Sample&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I converted the code to a subroutine that receives arguments similar to the iLogic command. Currently, it supports a single column filter. In my case, I know StockNumber is unique.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Private Sub Main()
	Break
	Call PlaceFromContentCenter("Fasteners", "Washers", "Plain", "NMC Flat Washer - Inch", "Stock Number", "030-0254")
End Sub

''' &amp;lt;summary&amp;gt;
''' Place a component from Content Center using VB.NET
''' &amp;lt;/summary&amp;gt;
''' &amp;lt;param name="oNode1"&amp;gt;Category&amp;lt;/param&amp;gt;
''' &amp;lt;param name="oNode2"&amp;gt;Subcategory&amp;lt;/param&amp;gt;
''' &amp;lt;param name="oNode3"&amp;gt;SubSubCategory&amp;lt;/param&amp;gt;
''' &amp;lt;param name="oFamilyName"&amp;gt;Family name&amp;lt;/param&amp;gt;
''' &amp;lt;param name="oColName"&amp;gt;Column name&amp;lt;/param&amp;gt;
''' &amp;lt;param name="oValue"&amp;gt;Value to find&amp;lt;/param&amp;gt;
Public Sub PlaceFromContentCenter(oNode1 As String, oNode2 As String, oNode3 As String, oFamilyName As String, oColName As String, oValue As String)
	Break
	logger.Trace("Entering PFCC")
    Dim asmDoc As AssemblyDocument = ThisApplication.Documents.Add(kAssemblyDocumentObject)
    
    Dim asmDef As AssemblyComponentDefinition = asmDoc.ComponentDefinition
    
    ' Get the node in the content browser based on the names of the nodes in the hierarchy.
'    Dim hexHeadNode As ContentTreeViewNode = ThisApplication.ContentCenter.TreeViewTopNode.ChildNodes.Item("Fasteners").ChildNodes.Item("Washers").ChildNodes.Item("Plain")
    Dim hexHeadNode As ContentTreeViewNode = ThisApplication.ContentCenter.TreeViewTopNode.ChildNodes.Item(oNode1).ChildNodes.Item(oNode2).ChildNodes.Item(oNode3)
    
    ' Find a specific family.  In this case it's using the display name, but any family
    ' characteristic could be searched for.
    Dim family As ContentFamily
    Dim checkFamily As ContentFamily
    For Each checkFamily In hexHeadNode.Families
'        If checkFamily.DisplayName = "NMC Flat Washer - Inch" Then
        If checkFamily.DisplayName = oFamilyName Then
            family = checkFamily
            Exit For
        End If
    Next
    
    Dim i As Integer = 0
    If Not family Is Nothing Then

        ' Place one instance of each member.
        Dim offset As Double
        offset = 0
        Dim row As ContentTableRow
		
		' Get column
		Dim oSNcol As Integer = 0		
		For i = 1 To family.TableColumns.Count
'			If family.TableColumns.Item(i).DisplayHeading = "Stock Number" Then
			If family.TableColumns.Item(i).DisplayHeading = oColName Then
				oSNcol = i
				Exit For
			End If
		Next i
		
		' create member if value is found
        For Each row In family.TableRows
            ' Create the member (part file) from the table.
            Dim failureReason As MemberManagerErrorsEnum
            Dim failureMessage As String
            Dim memberFilename As String
					
			If oSNcol &amp;lt;&amp;gt; 0 Then
'				If row.Item(oSNcol).Value = "030-0254" Then
				If row.Item(oSNcol).Value = oValue Then
					memberFilename = family.CreateMember(row, failureReason, failureMessage, kRefreshOutOfDateParts)
				Else
					memberFilename = Nothing
				End If
			End If
            
			Break
			
            ' Place the part into the assembly.
			If Not IsNothing(memberFilename) AndAlso memberFilename.Length &amp;lt;&amp;gt; 0 Then
				Dim transMatrix As Matrix = ThisApplication.TransientGeometry.CreateMatrix
				transMatrix.Cell(2, 4) = offset
				Dim Occ As ComponentOccurrence = asmDef.Occurrences.Add(memberFilename, transMatrix)
            
	            ' Compute the position for the next placement based on the size of the part just placed.
	            Dim minY As Double
	            Dim maxY As Double
	            minY = Occ.RangeBox.MinPoint.Y
	            maxY = Occ.RangeBox.MaxPoint.Y
	            offset = offset + ((maxY - minY) * 1.1)
			End If
				
        Next
    End If
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the example above, I am searching for a plain flat washer having a specific stock number. Since the code originally placed multiple parts, you could remove a large portion of the code in lines 75-86 that increments the insertion point. For a single part, your would just need line 78.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I left commented lines in the code that represent the hard-coded search for that specific washer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All that code above can make one appreciate how much work is going on inside the iLogic '&lt;SPAN&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;Components.AddContentCenterPart&lt;/FONT&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim Washer1 = Components.AddContentCenterPart(
   "Washer1",
   "Fasteners:Washers:Plain",
   "NMC Flat Washer - Inch",
   { "StockNumber", "030-0254" },
   position := Nothing, grounded := False,
   visible := True, appearance := Nothing)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let us know if this is helpful. Please mark as 'Accepted' if this answers your question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 14:06:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13327888#M2153</guid>
      <dc:creator>JBerns</dc:creator>
      <dc:date>2025-02-19T14:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13327990#M2154</link>
      <description>&lt;P&gt;Sorry, I should have specified that CreateMember is looking for a ContentIdentifier or the TableRow object, not just the index. Instead of 14, try oFamily.TableRows(14) or oFamily.TableRows(14).ContentIdentifier&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 14:36:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13327990#M2154</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2025-02-19T14:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328083#M2155</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thanks for input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is what happens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;oFamily.TableRows(14) fails here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="J_Dumont_0-1739977707056.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1468742iB0B8DD53BA70C3FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="J_Dumont_0-1739977707056.png" alt="J_Dumont_0-1739977707056.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;oFamily.TableRows(14).ContentIdentifier fails here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="J_Dumont_1-1739977734725.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1468743i8A0F1011113A4E95/image-size/medium?v=v2&amp;amp;px=400" role="button" title="J_Dumont_1-1739977734725.png" alt="J_Dumont_1-1739977734725.png" /&gt;&lt;/span&gt;&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>Wed, 19 Feb 2025 15:12:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328083#M2155</guid>
      <dc:creator>J_Dumont</dc:creator>
      <dc:date>2025-02-19T15:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328091#M2156</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/582192"&gt;@JBerns&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This looks great, thank you.&lt;/P&gt;&lt;P&gt;I'm working on getting the rows to work because I think that might be the simplest approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For PEM nuts, I would need to search for "Thread_Code" and "Shank_Code."&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="J_Dumont_2-1739978054750.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1468745iE224F77111948831/image-size/medium?v=v2&amp;amp;px=400" role="button" title="J_Dumont_2-1739978054750.png" alt="J_Dumont_2-1739978054750.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 15:14:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328091#M2156</guid>
      <dc:creator>J_Dumont</dc:creator>
      <dc:date>2025-02-19T15:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328128#M2157</link>
      <description>&lt;P&gt;Sorry, I was mistaken about using .ContentIdentifier and your earlier row number. It should take a TableRow(14), 14, or TableRow(14).InternalName. Regardless, where you add an occurrence, it needs to be to the ComponentDefinition, not the Document object.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 15:30:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328128#M2157</guid>
      <dc:creator>jjstr8</dc:creator>
      <dc:date>2025-02-19T15:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328334#M2158</link>
      <description>&lt;P&gt;It was an issue with the component definition.&lt;/P&gt;&lt;P&gt;Below is the code that is working.&lt;/P&gt;&lt;P&gt;Thank you both so much for replying and helping me with this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    Public Sub InsertPEMNuts()
        Dim asmDef As AssemblyComponentDefinition
        asmDef = oDoc.ComponentDefinition

        ' Get the node in the content browser based on the names of the nodes in the hierarchy.
        Dim hexHeadNode As ContentTreeViewNode
        hexHeadNode = g_inventorApplication.ContentCenter.TreeViewTopNode.ChildNodes.Item("Sheet Metal").ChildNodes.Item("Nuts")

        ' Find a specific family.
        Dim family As ContentFamily
        Dim checkFamily As ContentFamily
        For Each checkFamily In hexHeadNode.Families
            If checkFamily.DisplayName = "PEM Self-Clinching Nuts S,SS,CLS,CLSS - Inch" Then
                family = checkFamily
                Exit For
            End If
        Next

        If Not family Is Nothing Then
            ' Place one instance of each member.
            Dim offset As Double
            offset = 0
            'Dim row As ContentTableRow
            ' Create the member (part file) from the table.
            Dim failureReason As MemberManagerErrorsEnum
            Dim failureMessage As String
            Dim memberFilename As String
            memberFilename = family.CreateMember(14, failureReason, failureMessage, ContentMemberRefreshEnum.kDoNotRefreshOutOfDateParts)

            ' Place the part into the assembly.
            Dim transMatrix As Matrix
            transMatrix = g_inventorApplication.TransientGeometry.CreateMatrix
            transMatrix.Cell(2, 4) = offset
            Dim Occ As ComponentOccurrence
            Occ = asmDef.Occurrences.Add(memberFilename, transMatrix)
        Else
            MsgBox("Content Center Family not Found for PEM Nuts.")
        End If
    End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 16:50:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328334#M2158</guid>
      <dc:creator>J_Dumont</dc:creator>
      <dc:date>2025-02-19T16:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Insert specific size fastener from Content Center using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328808#M2159</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/533605"&gt;@J_Dumont&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You're welcome.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 20:45:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/insert-specific-size-fastener-from-content-center-using-vb-net/m-p/13328808#M2159</guid>
      <dc:creator>JBerns</dc:creator>
      <dc:date>2025-02-19T20:45:28Z</dc:date>
    </item>
  </channel>
</rss>

