<?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: Create Assembly from Excel List in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8228764#M88183</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6349784"&gt;@DFitting&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below iLogic code to add content center file to assembly file. It is considered for below example.&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="content centre trigger option.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/539727i805E9A455A194EFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="content centre trigger option.png" alt="content centre trigger option.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;Sub PlaceContentCenterPart()

    ' Set a reference to the active assembly document.
    Dim oDoc As AssemblyDocument
    oDoc = ThisApplication.ActiveDocument

    ' Set a reference to the ContentCenter object.
    Dim oContentCenter As ContentCenter
    oContentCenter = ThisApplication.ContentCenter

    ' Get the content node (category) "Fasteners:Bolts:Hex Head"
    Dim oContentNode As ContentTreeViewNode
    oContentNode = oContentCenter.TreeViewTopNode.ChildNodes.Item("Fasteners").ChildNodes.Item("Bolts").ChildNodes.Item("Hex Head")

    ' Get the "ISO 4015" Family object.
    Dim oFamily As ContentFamily
    For Each oFamily In oContentNode.Families
        If oFamily.DisplayName = "ISO 4015" Then
            Exit For
        End If
    Next

    ' Create a member based on the first row of the family.
    Dim Error1 As MemberManagerErrorsEnum
    Dim strContentPartFileName As String
    Dim strErrorMessage As String
    strContentPartFileName = oFamily.CreateMember(1, Error1, strErrorMessage)

   ' Dim oMat As Matrix
   ' oMat = ThisApplication.TransientGeometry.CreateMatrix

    ' Insert an instance of the content center member in the assembly.
    'Call oDoc.ComponentDefinition.Occurrences.Add(strContentPartFileName, oMat)
    ' Set a reference to the transient geometry object.
    Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
    
' Create a matrix.  
Dim oMatrix As Matrix
oMatrix = oTG.CreateMatrix

'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence

'place an instance of the component 
'in this case at 0,0,0
'positioned at the co-ordinates
oMatrix.SetTranslation(oTG.CreateVector(0, 0, 0)) 

oOccurrence = oAsmCompDef.Occurrences.Add(strContentPartFileName, oMatrix) 
oOccurrence.Grounded = False
End Sub&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
    <pubDate>Tue, 28 Aug 2018 05:08:03 GMT</pubDate>
    <dc:creator>chandra.shekar.g</dc:creator>
    <dc:date>2018-08-28T05:08:03Z</dc:date>
    <item>
      <title>Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219623#M88059</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;Is it possible for Inventor to create assemblies from a template assembly from an excel list? The files would be named as such and would all be in the same folder? I have some base code setup that will separate&amp;nbsp;the name into meaningful variables that will, in theory, change out the parts inside the assemblies once created. I just need help with getting Inventor to create the assemblies from excel.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;NOZLC2-RF150-8-40-AUX.iam&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;NOZLC2-RF150-8-40-BV&lt;SPAN&gt;.iam&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;NOZLC2-RF150-8-80-AUX&lt;SPAN&gt;.iam&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;NOZLC2-RF150-8-80-BV&lt;SPAN&gt;.iam&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;NOZLC2-RF150-10-40-AUX&lt;SPAN&gt;.iam&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;NOZLC2-RF150-10-40-BV&lt;SPAN&gt;.iam&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;NOZLC2-RF150-10-80-AUX&lt;SPAN&gt;.iam&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 14:12:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219623#M88059</guid>
      <dc:creator>DFitting</dc:creator>
      <dc:date>2018-08-23T14:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219718#M88065</link>
      <description>&lt;P&gt;You should be able to create empty iam, ipt files with the name in excel.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 14:37:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219718#M88065</guid>
      <dc:creator>Frederick_Law</dc:creator>
      <dc:date>2018-08-23T14:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219729#M88066</link>
      <description>&lt;P&gt;but how, using ilogic?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 14:39:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219729#M88066</guid>
      <dc:creator>DFitting</dc:creator>
      <dc:date>2018-08-23T14:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219750#M88067</link>
      <description>&lt;P&gt;iLogic, macro, Add-in, Apprentice.&lt;/P&gt;&lt;P&gt;Depends on how you want to do it.&lt;/P&gt;&lt;P&gt;Even in excel.&lt;/P&gt;&lt;P&gt;Create an empty iam.&amp;nbsp; Copy and rename the file using macro in excel.&amp;nbsp; You can even use Windows script or batch file.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 14:44:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219750#M88067</guid>
      <dc:creator>Frederick_Law</dc:creator>
      <dc:date>2018-08-23T14:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219866#M88073</link>
      <description>&lt;P&gt;Oh ok, I see what you are saying now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current thoughts are to run the ilogic code from an inventor assembly that will create all the assemblies and then when each is created it will switch out the parts inside the assemblies to configure the part the correct way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this example, there are about 3000 assembly&amp;nbsp;variations that need to be created. Each assembly&amp;nbsp;has a pipe and a flange, and based off the file name it is either a raised face slip on or a weld neck. I already have the code working that will take the file name and determine what the parts inside should be, and it is switching the parts out based on this data. I just need a way to create the assemblies that will enable this other rule to be activated, I don't want it to be an event trigger as I would rather not have the rule run each time that the file is opened or saved or whatever. Ideally, when the assembly is created it would run the subroutine and go ahead and change out the flanges and pipes then. I think I will be able to do most of that, I just don't&amp;nbsp;know how to get started on inventor creating the assemblies.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is a sample of a nozzle that has the pipe and the flange and the assembly file with the ilogic&amp;nbsp;inside. I have&amp;nbsp;them saved in a 2019 folder in my public folder, if you duplicate this setup, you can delete the parts inside the assembly and run the rule to see what it is doing. I have downloaded a flange from the content center just as a test, once I get it all ready, I will be pulling from the content center, I don't want to edit the families until I know it will work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 15:19:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8219866#M88073</guid>
      <dc:creator>DFitting</dc:creator>
      <dc:date>2018-08-23T15:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8222223#M88108</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6349784"&gt;@DFitting&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below code in the main assembly to create new assembly. After that, two components are added. To add constraints, face entities are needed. Which can be done through adding attribute set to faces.&lt;/P&gt;
&lt;PRE&gt;Dim path As String
path = "D:\Chandra\Autodesk Cases\Inventor\Aug-2018\14537574\"

Dim oList As ArrayList
oList = GoExcel.CellValues(path + "Assembly_List.xlsx", "Sheet1", "A1", "A7")

For Each name In oList
	Dim oNewAssy As AssemblyDocument
	oNewAssy = ThisApplication.Documents.Add(DocumentTypeEnum.kAssemblyDocumentObject)
	
	Dim oMatrix As Matrix
	oMatrix = ThisApplication.TransientGeometry.CreateMatrix() 
	
	Dim componentA As ComponentOccurrence 
	componentA = oNewAssy.ComponentDefinition.Occurrences.Add("D:\Chandra\Autodesk Cases\Inventor\Aug-2018\14537574\NOZLC2-RF150-8-40-AUX\PIPES\PIPEC2-40-8.ipt", oMatrix)
	componentA.Name = "Pipe"
	
	Dim componentB As ComponentOccurrence 
	componentB = oNewAssy.ComponentDefinition.Occurrences.Add("D:\Chandra\Autodesk Cases\Inventor\Aug-2018\14537574\NOZLC2-RF150-8-40-AUX\FLANGES\RF150-2.ipt", oMatrix)
	componentB.Name = "Flange"
	 
	Call oNewAssy.SaveAs(path + name, False)
	
	Call oNewAssy.Close
Next&lt;/PRE&gt;
&lt;P&gt;Before running this code, update the paths of excel file, RF150-2.ipt and PIPEC2-40-8.ipt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 11:33:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8222223#M88108</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-08-24T11:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8222937#M88117</link>
      <description>&lt;P&gt;YOU ARE AMAZING!! Thank you so much. The only thing I had to change was adding the file extension to the code!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Call oNewAssy.SaveAs(path + name + ".iam", False)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 15:45:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8222937#M88117</guid>
      <dc:creator>DFitting</dc:creator>
      <dc:date>2018-08-24T15:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8223086#M88122</link>
      <description>&lt;P&gt;Thanks again for the assistance.&amp;nbsp; Whats the line to add a component from the content center and the line for adding an insert constraint?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried these, to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;componentA&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt; 
	&lt;SPAN&gt;componentA&lt;/SPAN&gt; = &lt;SPAN&gt;oNewAssy&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;"C:\Users\Public\2019\PIPES\PIPEC2-40-16.ipt"&lt;/SPAN&gt;, &lt;SPAN&gt;oMatrix&lt;/SPAN&gt;)
	&lt;SPAN&gt;componentA&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"Pipe"&lt;/SPAN&gt;

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;componentB&lt;/SPAN&gt; = &lt;SPAN&gt;oNewAssy&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN&gt;AddContentCenterPart&lt;/SPAN&gt;(&lt;SPAN&gt;"Flange"&lt;/SPAN&gt;, &lt;SPAN&gt;"Tube &amp;amp; Pipe:Fittings:Flanges"&lt;/SPAN&gt;, &lt;SPAN&gt;"ASME B16.5 Flange Slip-On Welding - Class"&lt;/SPAN&gt;, 
	{&lt;SPAN&gt;"ND"&lt;/SPAN&gt;,&lt;SPAN&gt;oNozSize&lt;/SPAN&gt;},&lt;SPAN&gt;position&lt;/SPAN&gt; := &lt;SPAN&gt;Nothing&lt;/SPAN&gt;, &lt;SPAN&gt;grounded&lt;/SPAN&gt; := &lt;SPAN&gt;False&lt;/SPAN&gt;,&lt;SPAN&gt;visible&lt;/SPAN&gt; := &lt;SPAN&gt;True&lt;/SPAN&gt;, &lt;SPAN&gt;appearance&lt;/SPAN&gt; := &lt;SPAN&gt;Nothing&lt;/SPAN&gt;)
													 

	&lt;SPAN&gt;oNewAssy&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN&gt;Constraints&lt;/SPAN&gt;.&lt;SPAN&gt;AddInsert&lt;/SPAN&gt;(&lt;SPAN&gt;"Insert1"&lt;/SPAN&gt;, &lt;SPAN&gt;"Pipe"&lt;/SPAN&gt;, &lt;SPAN&gt;"Flange Face"&lt;/SPAN&gt;, &lt;SPAN&gt;"Flange"&lt;/SPAN&gt;, &lt;SPAN&gt;"Flange Face"&lt;/SPAN&gt;,
    &lt;SPAN&gt;axesOpposed&lt;/SPAN&gt; := &lt;SPAN&gt;Axis&lt;/SPAN&gt;, &lt;SPAN&gt;distance&lt;/SPAN&gt; := &lt;SPAN&gt;InsertDis&lt;/SPAN&gt;, &lt;SPAN&gt;lockRotation&lt;/SPAN&gt; := &lt;SPAN&gt;True&lt;/SPAN&gt;, &lt;SPAN&gt;biasPoint1&lt;/SPAN&gt; := &lt;SPAN&gt;Nothing&lt;/SPAN&gt;, &lt;SPAN&gt;biasPoint2&lt;/SPAN&gt; := &lt;SPAN&gt;Nothing&lt;/SPAN&gt;)&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Aug 2018 16:45:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8223086#M88122</guid>
      <dc:creator>DFitting</dc:creator>
      <dc:date>2018-08-24T16:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8228764#M88183</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6349784"&gt;@DFitting&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below iLogic code to add content center file to assembly file. It is considered for below example.&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="content centre trigger option.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/539727i805E9A455A194EFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="content centre trigger option.png" alt="content centre trigger option.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;Sub PlaceContentCenterPart()

    ' Set a reference to the active assembly document.
    Dim oDoc As AssemblyDocument
    oDoc = ThisApplication.ActiveDocument

    ' Set a reference to the ContentCenter object.
    Dim oContentCenter As ContentCenter
    oContentCenter = ThisApplication.ContentCenter

    ' Get the content node (category) "Fasteners:Bolts:Hex Head"
    Dim oContentNode As ContentTreeViewNode
    oContentNode = oContentCenter.TreeViewTopNode.ChildNodes.Item("Fasteners").ChildNodes.Item("Bolts").ChildNodes.Item("Hex Head")

    ' Get the "ISO 4015" Family object.
    Dim oFamily As ContentFamily
    For Each oFamily In oContentNode.Families
        If oFamily.DisplayName = "ISO 4015" Then
            Exit For
        End If
    Next

    ' Create a member based on the first row of the family.
    Dim Error1 As MemberManagerErrorsEnum
    Dim strContentPartFileName As String
    Dim strErrorMessage As String
    strContentPartFileName = oFamily.CreateMember(1, Error1, strErrorMessage)

   ' Dim oMat As Matrix
   ' oMat = ThisApplication.TransientGeometry.CreateMatrix

    ' Insert an instance of the content center member in the assembly.
    'Call oDoc.ComponentDefinition.Occurrences.Add(strContentPartFileName, oMat)
    ' Set a reference to the transient geometry object.
    Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
    
' Create a matrix.  
Dim oMatrix As Matrix
oMatrix = oTG.CreateMatrix

'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence

'place an instance of the component 
'in this case at 0,0,0
'positioned at the co-ordinates
oMatrix.SetTranslation(oTG.CreateVector(0, 0, 0)) 

oOccurrence = oAsmCompDef.Occurrences.Add(strContentPartFileName, oMatrix) 
oOccurrence.Grounded = False
End Sub&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 05:08:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8228764#M88183</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-08-28T05:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8229872#M88200</link>
      <description>&lt;P&gt;Thanks for your assistance, the code&amp;nbsp;I've&amp;nbsp;been working on is just about complete. I've&amp;nbsp;figured out a way for a workaround for placing content center parts, I have switched to simply placing them from their respective&amp;nbsp;content center windows explorer folder locations, since iLogic cannot currently place custom item, such as pipes where we can pick various lengths.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, what I am wanting for this code, is to place 2 parts from an excel list, and use their named faced, the new 2019 assign name feature, to constrain&amp;nbsp;with an insert constraint that the value varies based off of their&amp;nbsp;sizes. Also, I will need this code to add some custom&amp;nbsp;iproperties&amp;nbsp;to the new assembly before closing it and moving&amp;nbsp;onto the next assembly. The assembly is used in our ASME vessels, and by having a custom iproperites it greatly reduces the amount of time in our drawing creations, mainly the schedule of openings. I just about have the code together, just missing the constraints and the custom iproperties.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ive&amp;nbsp;attached some sample parts where they have the named faces and an excel file. Ive&amp;nbsp;also attached the entire code that I have been working on. The iproperties&amp;nbsp;assigned are the part number, description and a custom named Service. If I could get some assistance with these last few things, I think that I would be able to finish the code and start creating all these assembly variations. Notice the excel file has 36,937 variations, really its around 210,000 but I changed it to only do the most popular assembly variations, lol, having this code will enable us to create all these, in sections&amp;nbsp;as I doubt my computer could handle all of them at once lol.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;path&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;
&lt;SPAN&gt;path&lt;/SPAN&gt; = &lt;SPAN&gt;"C:\Users\Public\2019\"&lt;/SPAN&gt;
&lt;SPAN&gt;NolzPath&lt;/SPAN&gt; = &lt;SPAN&gt;"C:\Users\Public\2019\NZLS\"&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oList&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ArrayList&lt;/SPAN&gt;
&lt;SPAN&gt;oList&lt;/SPAN&gt; = &lt;SPAN&gt;GoExcel&lt;/SPAN&gt;.&lt;SPAN&gt;CellValues&lt;/SPAN&gt;(&lt;SPAN&gt;path&lt;/SPAN&gt; + &lt;SPAN&gt;"ASSEMBLY GENERATOR.xlsx"&lt;/SPAN&gt;, &lt;SPAN&gt;"Nozzles"&lt;/SPAN&gt;, &lt;SPAN&gt;"O2"&lt;/SPAN&gt;, &lt;SPAN&gt;"O3"&lt;/SPAN&gt;)
&lt;SPAN&gt;'oList = GoExcel.CellValues(path + "ASSEMBLY GENERATOR.xlsm", "Nozzles", "O2", "O3")&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;name&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oList&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oNewAssy&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyDocument&lt;/SPAN&gt;
	&lt;SPAN&gt;oNewAssy&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;Documents&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kAssemblyDocumentObject&lt;/SPAN&gt;)
	


	&lt;SPAN&gt;oNozSize&lt;/SPAN&gt; = &lt;SPAN&gt;Split&lt;/SPAN&gt;(&lt;SPAN&gt;name&lt;/SPAN&gt;, &lt;SPAN&gt;"-"&lt;/SPAN&gt;)(0)
	&lt;SPAN&gt;'MessageBox.Show(oNozSize, "SIZE")&lt;/SPAN&gt;
	&lt;SPAN&gt;oNozSch&lt;/SPAN&gt; = &lt;SPAN&gt;Split&lt;/SPAN&gt;(&lt;SPAN&gt;name&lt;/SPAN&gt;, &lt;SPAN&gt;"-"&lt;/SPAN&gt;)(1)
	&lt;SPAN&gt;'MessageBox.Show(oNozSch, "SCH")&lt;/SPAN&gt;
	&lt;SPAN&gt;oNozLen&lt;/SPAN&gt; = &lt;SPAN&gt;Split&lt;/SPAN&gt;(&lt;SPAN&gt;name&lt;/SPAN&gt;, &lt;SPAN&gt;"-"&lt;/SPAN&gt;)(2)
	&lt;SPAN&gt;'MessageBox.Show(oNozLen, "LEN")&lt;/SPAN&gt;
	&lt;SPAN&gt;oFlgTypeRtng&lt;/SPAN&gt; = &lt;SPAN&gt;Split&lt;/SPAN&gt;(&lt;SPAN&gt;name&lt;/SPAN&gt;, &lt;SPAN&gt;"-"&lt;/SPAN&gt;)(3)
	&lt;SPAN&gt;'MessageBox.Show(oFlgTypeRtng, "")&lt;/SPAN&gt;
	&lt;SPAN&gt;oNozServ&lt;/SPAN&gt; = &lt;SPAN&gt;Split&lt;/SPAN&gt;(&lt;SPAN&gt;name&lt;/SPAN&gt;, &lt;SPAN&gt;"-"&lt;/SPAN&gt;)(4)
	&lt;SPAN&gt;'MessageBox.Show(oNozServ, "SERVICE")&lt;/SPAN&gt;
	
	&lt;SPAN&gt;''remove 1st 5 charachters from file name - ie. NOZLC&lt;/SPAN&gt;
	&lt;SPAN&gt;oNozSize&lt;/SPAN&gt; = &lt;SPAN&gt;Right&lt;/SPAN&gt;(&lt;SPAN&gt;oNozSize&lt;/SPAN&gt;, &lt;SPAN&gt;Len&lt;/SPAN&gt;(&lt;SPAN&gt;oNozSize&lt;/SPAN&gt;) - 5)
	&lt;SPAN&gt;'MessageBox.Show(oNozSize,"size")&lt;/SPAN&gt;
	&lt;SPAN&gt;'create values for the rating and type of flange. ie RF150 is RF and 150&lt;/SPAN&gt;
	&lt;SPAN&gt;oFlgType&lt;/SPAN&gt; = &lt;SPAN&gt;Left&lt;/SPAN&gt;(&lt;SPAN&gt;oFlgTypeRtng&lt;/SPAN&gt;, &lt;SPAN&gt;Len&lt;/SPAN&gt;(&lt;SPAN&gt;oFlgTypeRtng&lt;/SPAN&gt;) - 3)
	&lt;SPAN&gt;oFlgRtng&lt;/SPAN&gt; = &lt;SPAN&gt;Right&lt;/SPAN&gt;(&lt;SPAN&gt;oFlgTypeRtng&lt;/SPAN&gt;, &lt;SPAN&gt;Len&lt;/SPAN&gt;(&lt;SPAN&gt;oFlgTypeRtng&lt;/SPAN&gt;) - 2)
	&lt;SPAN&gt;'MessageBox.Show(oFlgType, "FLNG TYPE")&lt;/SPAN&gt;
	&lt;SPAN&gt;'MessageBox.Show(oFlgRtng,"FLNG RATING")&lt;/SPAN&gt;

	&lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;oNozSize&lt;/SPAN&gt; = (&lt;SPAN&gt;oNozSize&lt;/SPAN&gt;).&lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;"/"&lt;/SPAN&gt;, &lt;SPAN&gt;"_"&lt;/SPAN&gt;)
	&lt;SPAN&gt;Catch&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
	
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oMatrix&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Matrix&lt;/SPAN&gt;
	&lt;SPAN&gt;oMatrix&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN&gt;CreateMatrix&lt;/SPAN&gt;() 
	
	
	&lt;SPAN&gt;FlangePath&lt;/SPAN&gt; = &lt;SPAN&gt;"Tube &amp;amp; Pipe:Fittings:Flanges"&lt;/SPAN&gt;
	
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oFlgType&lt;/SPAN&gt; = &lt;SPAN&gt;"RF"&lt;/SPAN&gt;
	&lt;SPAN&gt;Select&lt;/SPAN&gt; &lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;oFlgRtng&lt;/SPAN&gt;
	&lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;"150"&lt;/SPAN&gt;
		&lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; = &lt;SPAN&gt;"ASME B16.5(21)\"&lt;/SPAN&gt;
	&lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;"300"&lt;/SPAN&gt;
		&lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; = &lt;SPAN&gt;"ASME B16.5(23)\"&lt;/SPAN&gt;
	&lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;"600"&lt;/SPAN&gt;
		&lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; = &lt;SPAN&gt;"ASME B16.5(25)\"&lt;/SPAN&gt;
	&lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;"900"&lt;/SPAN&gt;
		&lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; = &lt;SPAN&gt;"ASME B16.5(26)\"&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Select&lt;/SPAN&gt;
	&lt;SPAN&gt;Axis&lt;/SPAN&gt; = &lt;SPAN&gt;"False"&lt;/SPAN&gt;
	&lt;SPAN&gt;InsertDis&lt;/SPAN&gt; = .5
	&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oFlgType&lt;/SPAN&gt; = &lt;SPAN&gt;"WN"&lt;/SPAN&gt;
	&lt;SPAN&gt;Select&lt;/SPAN&gt; &lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;oFlgRtng&lt;/SPAN&gt;
	&lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;"150"&lt;/SPAN&gt;
		&lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; = &lt;SPAN&gt;"ASME B16.5(38)\"&lt;/SPAN&gt;
	&lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;"300"&lt;/SPAN&gt;
		&lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; = &lt;SPAN&gt;"ASME B16.5(41\"&lt;/SPAN&gt;
	&lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;"600"&lt;/SPAN&gt;
		&lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; = &lt;SPAN&gt;"ASME B16.5(43)\"&lt;/SPAN&gt;
	&lt;SPAN&gt;Case&lt;/SPAN&gt; &lt;SPAN&gt;"900"&lt;/SPAN&gt;
		&lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; = &lt;SPAN&gt;"ASME B16.5(44)\"&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Select&lt;/SPAN&gt;
	&lt;SPAN&gt;Axis&lt;/SPAN&gt; = &lt;SPAN&gt;"True"&lt;/SPAN&gt;
	&lt;SPAN&gt;InsertDis&lt;/SPAN&gt; = .125
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;		
	&lt;SPAN&gt;'MessageBox.Show(FlangeFolder, "Title")&lt;/SPAN&gt;

	'\\\ here are the paths where the flanges and pipe are saved at. 
	&lt;SPAN&gt;PipePath&lt;/SPAN&gt; = &lt;SPAN&gt;"C:\Users\dfitting\Documents\Inventor\Content Center Files\R2019\en-US\ASME B36.10M(1)\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"PIPEC"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oNozSize&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oNozSch&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"-"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oNozLen&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;".ipt"&lt;/SPAN&gt;
	&lt;SPAN&gt;FlangePath&lt;/SPAN&gt; = &lt;SPAN&gt;"C:\Users\dfitting\Documents\Inventor\Content Center Files\R2019\en-US\"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;FlangeFolder&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"FLNGC"&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oNozSize&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;".ipt"&lt;/SPAN&gt;

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;componentA&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt; 
	&lt;SPAN&gt;componentA&lt;/SPAN&gt; = &lt;SPAN&gt;oNewAssy&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;PipePath&lt;/SPAN&gt;, &lt;SPAN&gt;oMatrix&lt;/SPAN&gt;)
	&lt;SPAN&gt;componentA&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"Pipe"&lt;/SPAN&gt;

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;componentB&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;ComponentOccurrence&lt;/SPAN&gt; 
	&lt;SPAN&gt;componentB&lt;/SPAN&gt; = &lt;SPAN&gt;oNewAssy&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Occurrences&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;FlangePath&lt;/SPAN&gt;, &lt;SPAN&gt;oMatrix&lt;/SPAN&gt;)
	&lt;SPAN&gt;componentB&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"Flange"&lt;/SPAN&gt;
	

	
	'////////Here is where I need the insert constraint and the iproperties modifications.
&lt;SPAN&gt;'	Dim componentC As ComponentOccurrence&lt;/SPAN&gt;
&lt;SPAN&gt;'	componentC = oNewAssy.ComponentDefinition.Occurrences.Add.Constraints("Insert1", "Pipe", "Flange Face", "Flange", "Flange Face",&lt;/SPAN&gt;
&lt;SPAN&gt;'                      axesOpposed := Axis, distance := InsertDis, lockRotation := True, biasPoint1 := Nothing, biasPoint2 := Nothing)&lt;/SPAN&gt;


&lt;SPAN&gt;'	oNewAssy.ComponentDefinition.Occurrences.Constraints.AddInsert("Insert1", "Pipe", "Flange Face", "Flange", "Flange Face",&lt;/SPAN&gt;
&lt;SPAN&gt;'    axesOpposed := Axis, distance := InsertDis, lockRotation := True, biasPoint1 := Nothing, biasPoint2 := Nothing)&lt;/SPAN&gt;



	&lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;name&lt;/SPAN&gt; = (&lt;SPAN&gt;name&lt;/SPAN&gt;).&lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;"/"&lt;/SPAN&gt;, &lt;SPAN&gt;"_"&lt;/SPAN&gt;)
	&lt;SPAN&gt;Catch&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;

	 
	&lt;SPAN&gt;Call&lt;/SPAN&gt; &lt;SPAN&gt;oNewAssy&lt;/SPAN&gt;.&lt;SPAN&gt;SaveAs&lt;/SPAN&gt;(&lt;SPAN&gt;NolzPath&lt;/SPAN&gt; + &lt;SPAN&gt;name&lt;/SPAN&gt; + &lt;SPAN&gt;".iam"&lt;/SPAN&gt;, &lt;SPAN&gt;False&lt;/SPAN&gt;)
	
	&lt;SPAN&gt;Call&lt;/SPAN&gt; &lt;SPAN&gt;oNewAssy&lt;/SPAN&gt;.&lt;SPAN&gt;Close&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 14:14:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8229872#M88200</guid>
      <dc:creator>DFitting</dc:creator>
      <dc:date>2018-08-28T14:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8231699#M88222</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6349784"&gt;@DFitting&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below iLogic code to add Insert constraint and custom iProperty.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim path As String
path = "C:\Users\Public\2019\"
NolzPath = "C:\Users\Public\2019\NZLS\"

Dim oList As ArrayList
oList = GoExcel.CellValues(path + "ASSEMBLY GENERATOR.xlsx", "Nozzles", "O5", "O6")
'oList = GoExcel.CellValues(path + "ASSEMBLY GENERATOR.xlsm", "Nozzles", "O2", "O3")

Dim FlangeFolder As String

For Each name In oList
	Dim oNewAssy As AssemblyDocument
	oNewAssy = ThisApplication.Documents.Add(DocumentTypeEnum.kAssemblyDocumentObject)
	


	oNozSize = Split(name, "-")(0)
	'MessageBox.Show(oNozSize, "SIZE")
	oNozSch = Split(name, "-")(1)
	'MessageBox.Show(oNozSch, "SCH")
	oNozLen = Split(name, "-")(2)
	'MessageBox.Show(oNozLen, "LEN")
	oFlgTypeRtng = Split(name, "-")(3)
	'MessageBox.Show(oFlgTypeRtng, "")
	oNozServ = Split(name, "-")(4)
	'MessageBox.Show(oNozServ, "SERVICE")
	
	''remove 1st 5 charachters from file name - ie. NOZLC
	oNozSize = Right(oNozSize, Len(oNozSize) - 5)
	'MessageBox.Show(oNozSize,"size")
	'create values for the rating and type of flange. ie RF150 is RF and 150
	oFlgType = Left(oFlgTypeRtng, Len(oFlgTypeRtng) - 3)
	oFlgRtng = Right(oFlgTypeRtng, Len(oFlgTypeRtng) - 2)
	'MessageBox.Show(oFlgType, "FLNG TYPE")
	'MessageBox.Show(oFlgRtng,"FLNG RATING")

	Try
	oNozSize = (oNozSize).Replace("/", "_")
	Catch
	End Try
	
	Dim oMatrix As Matrix
	oMatrix = ThisApplication.TransientGeometry.CreateMatrix() 
	
	
	FlangePath = "Tube &amp;amp; Pipe:Fittings:Flanges"
	
	If oFlgType = "RF"
	Select Case oFlgRtng
	Case "150"
		FlangeFolder = "ASME B16.5(21)\"
	Case "300"
		FlangeFolder = "ASME B16.5(23)\"
	Case "600"
		FlangeFolder = "ASME B16.5(25)\"
	Case "900"
		FlangeFolder = "ASME B16.5(26)\"
	End Select
	Axis = "False"
	InsertDis = .5
	Else If oFlgType = "WN"
	Select Case oFlgRtng
	Case "150"
		FlangeFolder = "ASME B16.5(38)\"
	Case "300"
		FlangeFolder = "ASME B16.5(41\"
	Case "600"
		FlangeFolder = "ASME B16.5(43)\"
	Case "900"
		FlangeFolder = "ASME B16.5(44)\"
	End Select
	Axis = "True"
	InsertDis = .125
	End If		
	'MessageBox.Show(FlangeFolder, "Title")

	'\\\ here are the paths where the flanges and pipe are saved at. 
	PipePath = "C:\Users\dfitting\Documents\Inventor\Content Center Files\R2019\en-US\ASME B36.10M(1)\" &amp;amp; "PIPEC" &amp;amp; oNozSize &amp;amp; "-" &amp;amp; oNozSch &amp;amp; "-" &amp;amp; oNozLen &amp;amp; ".ipt"
	FlangePath = "C:\Users\dfitting\Documents\Inventor\Content Center Files\R2019\en-US\" &amp;amp; FlangeFolder &amp;amp; "FLNGC" &amp;amp; oNozSize &amp;amp; ".ipt"

	Dim componentA As ComponentOccurrence 
	componentA = oNewAssy.ComponentDefinition.Occurrences.Add(PipePath, oMatrix)
	componentA.Name = "Pipe"

	Dim componentB As ComponentOccurrence 
	componentB = oNewAssy.ComponentDefinition.Occurrences.Add(FlangePath, oMatrix)
	componentB.Name = "Flange" 
	
	Dim oFace As Face
	Dim oFlangeFace_Pipe As Face
	Dim oInsideFace_Pipe As Face
	For Each oFace In componentA.Definition.SurfaceBodies.Item(1).Faces
		If oFace.InternalName = "{D2F0749E-CD50-6222-9FD3-82A95937E2C7}" Then
		    oFlangeFace_Pipe = oFace
		ElseIf oFace.InternalName = "{34E025BE-9958-2F5D-43C5-4A4EDECF143F}" Then
		    oInsideFace_Pipe = oFace
		End If
	Next
 
	 
	Dim oFlangeFace_Flange As Face
	For Each oFace In componentB.Definition.SurfaceBodies.Item(1).Faces
		If oFace.InternalName = "{F5A66A0A-37CA-1154-750F-3BE821568F9F}" Then
		    oFlangeFace_Flange = oFace
		    Exit For
		End If
	Next

	Dim oFaceProxy_pipe As FaceProxy
	If Not oFlangeFace_Pipe Is Nothing Then
		Call componentA.CreateGeometryProxy(oFlangeFace_Pipe, oFaceProxy_pipe)
	Else
		Exit Sub
	End If

	Dim oFaceProxy_Flange As FaceProxy
	If Not oFlangeFace_Flange Is Nothing Then
		Call componentB.CreateGeometryProxy(oFlangeFace_Flange, oFaceProxy_Flange)
	Else
		Exit Sub
	End If

	Call oNewAssy.ComponentDefinition.Constraints.AddInsertConstraint(oFaceProxy_pipe, oFaceProxy_Flange, False, InsertDis)

	Dim oCustomProp As Inventor.Property 
	Try
		oNewAssy.PropertySets.Item(4).Item("Custom Prop").Value = "Custom Value"
	Catch
		oCustomProp = oNewAssy.PropertySets.Item(4).Add("Custom value", "Custom Prop")
	End Try 
	oNewAssy.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value = "123456"
	oNewAssy.PropertySets.Item("Design Tracking Properties").Item("Description").Value = "Description"

	Try
	name = (name).Replace("/", "_")
	Catch
	End Try

	 
	Call oNewAssy.SaveAs(NolzPath + name + ".iam", False)
	
	Call oNewAssy.Close
Next&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Note :&lt;/U&gt;&lt;/STRONG&gt; currently, internal names are determined from attached parts.&amp;nbsp;Internal name of face varies from part to part. If you are using new part, need to identify internal name by below code. After selection of face, run below code to get internal name of face.&lt;/P&gt;
&lt;PRE&gt;Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument 

Dim oFace As Face 
oFace = oDoc.SelectSet.Item(1)

MessageBox.Show(oFace.InternalName, "Internal name")&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 07:02:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8231699#M88222</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-08-29T07:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8233166#M88243</link>
      <description>&lt;P&gt;Thanks again.&amp;nbsp;How do I add a mate constraint between the pipe and the flange XZ origin planes, it looks like both of their Internal names are the same - {5DF8608B-6B16-11D3-B794-0060B0F159EF}?&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, 29 Aug 2018 16:41:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8233166#M88243</guid>
      <dc:creator>DFitting</dc:creator>
      <dc:date>2018-08-29T16:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8234383#M88275</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6349784"&gt;@DFitting&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try below iLogic code.&lt;/P&gt;
&lt;PRE&gt;Dim path As String
path = "C:\Users\Public\2019\"
NolzPath = "C:\Users\Public\2019\NZLS\"

Dim oList As ArrayList
oList = GoExcel.CellValues(path + "ASSEMBLY GENERATOR.xlsx", "Nozzles", "O5", "O6")
'oList = GoExcel.CellValues(path + "ASSEMBLY GENERATOR.xlsm", "Nozzles", "O2", "O3")

Dim FlangeFolder As String

For Each name In oList
	Dim oNewAssy As AssemblyDocument
	oNewAssy = ThisApplication.Documents.Add(DocumentTypeEnum.kAssemblyDocumentObject)
	


	oNozSize = Split(name, "-")(0)
	'MessageBox.Show(oNozSize, "SIZE")
	oNozSch = Split(name, "-")(1)
	'MessageBox.Show(oNozSch, "SCH")
	oNozLen = Split(name, "-")(2)
	'MessageBox.Show(oNozLen, "LEN")
	oFlgTypeRtng = Split(name, "-")(3)
	'MessageBox.Show(oFlgTypeRtng, "")
	oNozServ = Split(name, "-")(4)
	'MessageBox.Show(oNozServ, "SERVICE")
	
	''remove 1st 5 charachters from file name - ie. NOZLC
	oNozSize = Right(oNozSize, Len(oNozSize) - 5)
	'MessageBox.Show(oNozSize,"size")
	'create values for the rating and type of flange. ie RF150 is RF and 150
	oFlgType = Left(oFlgTypeRtng, Len(oFlgTypeRtng) - 3)
	oFlgRtng = Right(oFlgTypeRtng, Len(oFlgTypeRtng) - 2)
	'MessageBox.Show(oFlgType, "FLNG TYPE")
	'MessageBox.Show(oFlgRtng,"FLNG RATING")

	Try
	oNozSize = (oNozSize).Replace("/", "_")
	Catch
	End Try
	
	Dim oMatrix As Matrix
	oMatrix = ThisApplication.TransientGeometry.CreateMatrix() 
	
	
	FlangePath = "Tube &amp;amp; Pipe:Fittings:Flanges"
	
	If oFlgType = "RF"
	Select Case oFlgRtng
	Case "150"
		FlangeFolder = "ASME B16.5(21)\"
	Case "300"
		FlangeFolder = "ASME B16.5(23)\"
	Case "600"
		FlangeFolder = "ASME B16.5(25)\"
	Case "900"
		FlangeFolder = "ASME B16.5(26)\"
	End Select
	Axis = "False"
	InsertDis = .5
	Else If oFlgType = "WN"
	Select Case oFlgRtng
	Case "150"
		FlangeFolder = "ASME B16.5(38)\"
	Case "300"
		FlangeFolder = "ASME B16.5(41\"
	Case "600"
		FlangeFolder = "ASME B16.5(43)\"
	Case "900"
		FlangeFolder = "ASME B16.5(44)\"
	End Select
	Axis = "True"
	InsertDis = .125
	End If		
	'MessageBox.Show(FlangeFolder, "Title")

	'\\\ here are the paths where the flanges and pipe are saved at. 
	PipePath = "C:\Users\dfitting\Documents\Inventor\Content Center Files\R2019\en-US\ASME B36.10M(1)\" &amp;amp; "PIPEC" &amp;amp; oNozSize &amp;amp; "-" &amp;amp; oNozSch &amp;amp; "-" &amp;amp; oNozLen &amp;amp; ".ipt"
	FlangePath = "C:\Users\dfitting\Documents\Inventor\Content Center Files\R2019\en-US\" &amp;amp; FlangeFolder &amp;amp; "FLNGC" &amp;amp; oNozSize &amp;amp; ".ipt"

	Dim componentA As ComponentOccurrence 
	componentA = oNewAssy.ComponentDefinition.Occurrences.Add(PipePath, oMatrix)
	componentA.Name = "Pipe"

	Dim componentB As ComponentOccurrence 
	componentB = oNewAssy.ComponentDefinition.Occurrences.Add(FlangePath, oMatrix)
	componentB.Name = "Flange" 
	
	Dim oFace As Face
	Dim oFlangeFace_Pipe As Face
	Dim oInsideFace_Pipe As Face
	For Each oFace In componentA.Definition.SurfaceBodies.Item(1).Faces
		If oFace.InternalName = "{D2F0749E-CD50-6222-9FD3-82A95937E2C7}" Then
		    oFlangeFace_Pipe = oFace
		ElseIf oFace.InternalName = "{34E025BE-9958-2F5D-43C5-4A4EDECF143F}" Then
		    oInsideFace_Pipe = oFace
		End If
	Next
 
	 
	Dim oFlangeFace_Flange As Face
	For Each oFace In componentB.Definition.SurfaceBodies.Item(1).Faces
		If oFace.InternalName = "{F5A66A0A-37CA-1154-750F-3BE821568F9F}" Then
		    oFlangeFace_Flange = oFace
		    Exit For
		End If
	Next

	Dim oFaceProxy_pipe As FaceProxy
	If Not oFlangeFace_Pipe Is Nothing Then
		Call componentA.CreateGeometryProxy(oFlangeFace_Pipe, oFaceProxy_pipe)
	Else
		Exit Sub
	End If

	Dim oFaceProxy_Flange As FaceProxy
	If Not oFlangeFace_Flange Is Nothing Then
		Call componentB.CreateGeometryProxy(oFlangeFace_Flange, oFaceProxy_Flange)
	Else
		Exit Sub
	End If

	Call oNewAssy.ComponentDefinition.Constraints.AddInsertConstraint(oFaceProxy_pipe, oFaceProxy_Flange, False, InsertDis)
	
	Dim xzPlaneA As WorkPlane
	xzPlaneA = componentA.Definition.Workplanes.Item("XZ Plane")
	Dim xzPlaneA_proxy As WorkPlaneProxy
	componentA.CreateGeometryProxy(xzPlaneA,xzPlaneA_proxy)

	Dim xzPlaneB As WorkPlane
	xzPlaneB = componentB.Definition.Workplanes.Item("XZ Plane")
	Dim xzPlaneB_proxy As WorkPlaneProxy
	componentB.CreateGeometryProxy(xzPlaneB, xzPlaneB_proxy)

	Call oNewAssy.ComponentDefinition.Constraints.AddMateConstraint(xzPlaneA_proxy,xzPlaneB_proxy,"0")

	Dim oCustomProp As Inventor.Property 
	Try
		oNewAssy.PropertySets.Item(4).Item("Custom Prop").Value = "Custom Value"
	Catch
		oCustomProp = oNewAssy.PropertySets.Item(4).Add("Custom value", "Custom Prop")
	End Try 
	oNewAssy.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value = "123456"
	oNewAssy.PropertySets.Item("Design Tracking Properties").Item("Description").Value = "Description"

	Try
	name = (name).Replace("/", "_")
	Catch
	End Try

	 
	Call oNewAssy.SaveAs(NolzPath + name + ".iam", False)
	
	Call oNewAssy.Close
Next

&lt;/PRE&gt;
&lt;P&gt;Thanks and regards,&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 04:57:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8234383#M88275</guid>
      <dc:creator>chandra.shekar.g</dc:creator>
      <dc:date>2018-08-30T04:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8235275#M88302</link>
      <description>&lt;P&gt;Thanks again!! With your help, I am now able to create an infinite amount of assembly variations for use in my vessel assembly creator.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 13:20:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/8235275#M88302</guid>
      <dc:creator>DFitting</dc:creator>
      <dc:date>2018-08-30T13:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create Assembly from Excel List</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/11431363#M142826</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was looking at the code and it looks interesting but can we also create a detailed drawing for all configurations? If so, would you please advise how?&lt;/P&gt;&lt;P&gt;Thank you very much for the support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 16:44:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-assembly-from-excel-list/m-p/11431363#M142826</guid>
      <dc:creator>elie.t.almurr</dc:creator>
      <dc:date>2022-09-19T16:44:07Z</dc:date>
    </item>
  </channel>
</rss>

