<?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: Ilogic create “empty parts“ and fill their iProperties from excel in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12208697#M157090</link>
    <description>&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried, but unfortunately I can't get it to work.&lt;/P&gt;&lt;P&gt;Row 1 are supposed to be custom iPropertys and always use the changing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you maybe create me again a code for this "that I can just paste"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That would be great, because I absolutely can not figure out what I'm doing wrong.&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="maxbaumann07_0-1693463461235.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1260270i3E731EB9C0E3502A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maxbaumann07_0-1693463461235.png" alt="maxbaumann07_0-1693463461235.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2023 06:32:59 GMT</pubDate>
    <dc:creator>max.baumann07</dc:creator>
    <dc:date>2023-08-31T06:32:59Z</dc:date>
    <item>
      <title>Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9850027#M117804</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to make an iLogic rule that creates “empty parts“ within an assembly and fill their iProperties from an excel sheet.&lt;/P&gt;&lt;P&gt;I do not want to create “virtual parts” but “empty parts (.ipt)“.&lt;/P&gt;&lt;P&gt;(I need the .ipt files later in Vault to follow an established process that brings articles (information of electric and hydraulic parts) into an ERP system. That’s why I do not want to use virtual parts)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main problem is that I am still just a beginner in iLogic/Vba/VB, so I do not know how to fit my snippets together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a rule that creates virtual parts in an assembly based on an excel sheet. It works fine.&lt;/P&gt;&lt;P&gt;(adjusting this rule to my own excel sheet requirements is doable for me).&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;'[ Browse for the Excel file
oMsg = "Select a Project Information Excel File"

'update the status bar 
ThisApplication.StatusBarText = oMsg

Dim oFileDlg As Inventor.FileDialog = Nothing
InventorVb.Application.CreateFileDialog(oFileDlg)
oFileDlg.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx"
oFileDlg.DialogTitle = oMsg
oFileDlg.InitialDirectory = ThisDoc.Path
oFileDlg.CancelError = True	

Try	
	oFileDlg.ShowOpen()
Catch
	'catch error when no file is selected
	Return 'exit rule
End Try

If Err.Number &amp;lt;&amp;gt; 0 Then	
	MessageBox.Show("A problem occured when getting the Excel file.", "iLogic",MessageBoxButtons.OK,MessageBoxIcon.Error)	
	Return 'exit if file not selected
	
ElseIf oFileDlg.FileName &amp;lt;&amp;gt; "" Then
	myXLS  = oFileDlg.FileName
	
	'update the status bar with the Excel file name
	ThisApplication.StatusBarText = "...reading info from " &amp;amp; myXLS
End If
']

Dim MyArrayList As New ArrayList
MyArrayList = GoExcel.CellValues(myXLS, "Sheet1", "A2", "A200")

'define assembly
Dim asmDoc As AssemblyDocument
asmDoc = ThisApplication.ActiveDocument
'define assembly Component Definition
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

Dim occs As ComponentOccurrences
occs = asmDoc.ComponentDefinition.Occurrences
 
Dim identity As Matrix
identity = ThisApplication.TransientGeometry.CreateMatrix

Dim sVirtPart As String

'get info from the XLS file
For MyRow = 2 To 200 'index row 2 through 200	
	
    iQTY = GoExcel.CellValue("A" &amp;amp; MyRow)
    oProp1 = GoExcel.CellValue("B" &amp;amp; MyRow)	
    oProp2 = GoExcel.CellValue("C" &amp;amp; MyRow)
    oProp3 = GoExcel.CellValue("D" &amp;amp; MyRow)
    oProp4 = GoExcel.CellValue("E" &amp;amp; MyRow)	
	sVirtPart = oProp1 'defines the virtual part name
	
	'update the status bar with the name
	ThisApplication.StatusBarText = sVirtPart
	
	'Iterate through all of the occurrences in the assembly
	Dim asmOcc As ComponentOccurrence
	For Each asmOcc  In oAsmCompDef.Occurrences
		'get name of occurence only (sees only everything left of the colon)
		Dim oOcc As Object
		oOcc = asmOcc.Name.Split(":")(0)
		'look at only virtual components
		If TypeOf asmOcc.Definition Is VirtualComponentDefinition Then
			'compare name selected from list to the
			'existing virtual parts
			If oOcc = sVirtPart Then
				'delete existing virtual parts if name matches
				asmOcc.Delete
			End If
		End If
	Next



	'create first instance of the virtual part
	Dim virtOcc As ComponentOccurrence
	If  iQTY &amp;gt;= 1 Then
		virtOcc = occs.AddVirtual(sVirtPart, identity)
		
		Try
		iProperties.Value(sVirtPart &amp;amp; ":1", "Project", "Description") = oProp1
		Catch 'catch error when oProp1 = nothing
		End Try
			
		Try
		iProperties.Value(sVirtPart &amp;amp; ":1", "Project", "Part Number") = oProp2
		Catch 'catch error when oProp2 = nothing
		End Try

		Try
		iProperties.Value(sVirtPart &amp;amp; ":1", "Project", "Vendor") = oProp3
		Catch 'catch error when oProp4 = nothing
		End Try
		
		Try
		iProperties.Value(sVirtPart &amp;amp; ":1", "Summary", "Comments") = oProp4
		Catch 'catch error when oProp5 = nothing
		End Try
	End If
	

	'add next instance starting at instance2 (if applicable)
	Dim index As Integer
	index = 2
	Do While index &amp;lt;= iQTY
		occs.AddByComponentDefinition(virtOcc.Definition, identity)
		index += 1
	Loop

Next

'update the status bar 
ThisApplication.StatusBarText = "Virtual components added!"&lt;/LI-CODE&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="Jakob_Hamburg_0-1604659907102.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/841046iA2D8D38911AB2603/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jakob_Hamburg_0-1604659907102.png" alt="Jakob_Hamburg_0-1604659907102.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;This rule comes from here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/ilogic-add-standard-virtual-parts-from-an-excel-file/td-p/6495912" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-customization/ilogic-add-standard-virtual-parts-from-an-excel-file/td-p/6495912&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(from post #12 in that thread)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as I said I cannot use virtual parts but I need real (empty) parts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I found another rule that creates one empty part (.ipt) in an existing assembly.&lt;/P&gt;&lt;P&gt;So I wonder if it is possible to replace parts in the first rule by the second rule in order to create real parts but not virtual parts.&lt;/P&gt;&lt;P&gt;And at which point a save command for new created parts (.ipt) should be added in the merged rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody have an advice for me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the second rule which creates one empty part (.ipt) in an existing assembly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim oAssDoc As AssemblyDocument
    oAssDoc = ThisApplication.ActiveDocument
    
     Dim oAssDef As AssemblyComponentDefinition
     oAssDef = oAssDoc.ComponentDefinition
    
    Dim oNewPart As PartDocument
     oNewPart = ThisApplication.Documents.Add(kPartDocumentObject, , False)
    
    Dim oNewPartDef As PartComponentDefinition
     oNewPartDef = oNewPart.ComponentDefinition
    
    'do what you need to create in this part
    'e.g. create a block
    
    
    
    'place without any transformation
    'can adjust the matrix with your requirement
    Dim oMartrix As Matrix
    oMatrix = ThisApplication.TransientGeometry.CreateMatrix()
    
    'add the new part to the assembly
    Dim oNewOcc As ComponentOccurrence
    oNewOcc = oAssDef.Occurrences.AddByComponentDefinition(oNewPartDef, oMatrix)
    
     
    
 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That rule comes from here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/creation-of-part-using-ilogic/td-p/6334536" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-customization/creation-of-part-using-ilogic/td-p/6334536&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does anybody have an advice for me?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 10:56:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9850027#M117804</guid>
      <dc:creator>Jakob_Hamburg</dc:creator>
      <dc:date>2020-11-06T10:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9851037#M117829</link>
      <description>&lt;P&gt;I think I may have a solution for you.&amp;nbsp; I included several comments within the code to help guide you through it.&amp;nbsp; If you have any questions before or after running it, just let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beware:&amp;nbsp; Near the end of the Sub Main...End Sub block, I am attempting to save each new Part file (one per row in Excel) to the same directory as the assembly.&amp;nbsp; If you don't want to save the Parts out yet, just delete that whole block of code (there are multiple comments above that line of code), or change it however you want (perhaps specify a different directory if you want).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, you will notice a couple of special lines at the top of this code.&amp;nbsp; Once you paste all this code into a Rule, those top two lines should automatically pop into to the Header portion of the rule editor's dialog.&amp;nbsp; They are needed so Inventor's iLogic environment can recognize all the objects defined within the Excel application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AddReference "Microsoft.Office.Interop.Excel.dll"
Imports Microsoft.Office.Interop.Excel
Sub Main
'Specify the Excel file's (Workbook) full path &amp;amp; file name (with extension)
'It is calling a Windows OpenFileDialog to allow the user to do this
Dim oFileName As String = GetExcelFile()
'Specify the Sheet name within the workbook
'perhaps this name could be selected from a list of all available sheets
'in the Excel Workbook once opened, of you don't want to manually specify it here?
Dim oSheetName As String = "Sheet1"

'Start a new instance of the Excel application
Dim oExcelApp As Microsoft.Office.Interop.Excel.Application
oExcelApp = New Microsoft.Office.Interop.Excel.ApplicationClass
oExcelApp.DisplayAlerts = False
oExcelApp.Visible = False

'[ Attempt to open the specified Workbook (file) using the supplied file name
Dim oWB As Workbook
Try
	oWB = oExcelApp.Workbooks.Open(oFileName)
Catch oEx As Exception
	MsgBox("The attempt to open the Excel file named '" &amp;amp; oFileName &amp;amp; "' failed." &amp;amp; vbCrLf &amp;amp; _
	"The error message for this failure is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.Message &amp;amp; vbCrLf &amp;amp;  vbCrLf &amp;amp; _
	"Its 'StackTrace is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.StackTrace &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _
	"Its source is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.Source, vbOKOnly + vbCritical, "Couldn't Open File")
	Exit Sub
End Try
'Attempt to get the Worksheet
Dim oWS As Worksheet
Try
	oWS = oWB.Sheets.Item(oSheetName)
Catch
	oWS = oWB.ActiveSheet
Catch
	oWS = oWB.Worksheets.Item(1)
Catch
	MsgBox("No Worksheet was found in the specified Excel file. Exiting.", vbOKOnly + vbCritical, " ")
	Exit Sub
End Try

Dim oCells As Range = oWS.Cells

'Define the active Assembly and all related variables
If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kAssemblyDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Assembly Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisAssembly.Document
Dim oDir As String = System.IO.Path.GetDirectoryName(oADoc.FullFileName)
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oOccs As ComponentOccurrences = oADef.Occurrences
Dim oOcc As ComponentOccurrence
Dim oPDoc As PartDocument
Dim oDProps As Inventor.PropertySet 'Design Tracking Properties (Project)
Dim oSProps As Inventor.PropertySet 'Inventor Summary Information (Summary)
Dim oMatrix As Inventor.Matrix = ThisApplication.TransientGeometry.CreateMatrix

'Find the last row and last column being used to limit our loop ranges
Dim oLastRow As Integer = oWS.UsedRange.Rows.Count
'Dim oLastCol As Integer = oWS.UsedRange.Columns.Count
'Dim oColumnHeadersRow As Integer = 1
Dim o1stDataRow As Integer = 2
Dim oRow, oQty As Integer
Dim oPName, oPNum, oVendor, oNotes As String

For oRow = o1stDataRow To oLastRow
	'First number is Row index, second number is Column Index
	oQty = oCells.Item(oRow, 1).Value
	oPName = oCells.Item(oRow, 2).Value
	oPNum = oCells.Item(oRow, 3).Value
	oVendor = oCells.Item(oRow, 4).Value
	oNotes = oCells.Item(oRow, 5).Value
	
	'Create the new Part
	oPDoc = ThisApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject, , False)
	'Set the iProperties within the new Part
	oDProps = oPDoc.PropertySets.Item("Design Tracking Properties")
	oSProps = oPDoc.PropertySets.Item("Inventor Summary Information")
	oDProps.Item("Description").Value = oPName
	oDProps.Item("Part Number").Value = oPNum
	oDProps.Item("Vendor").Value = oVendor
	oSProps.Item("Comments").Value = oNotes
	
	'&amp;lt;&amp;lt;&amp;lt;&amp;lt; !!! CHECK IF THIS IS OK BEFORE RUNNING !!! &amp;gt;&amp;gt;&amp;gt;&amp;gt;
	'Saving each new Part to the same directory as the Assembly
	'if this is not OK, you could specify a different directory
	'or you could use a SaveFileDialog for this
	'or just skip saving the parts at this stage altogether
	oPDoc.SaveAs(oDir &amp;amp; "\" &amp;amp; oPName &amp;amp; ".ipt", False)
	
	'Add that many of this part to the assembly
	For i = 1 To oQty
		oOccs.AddByComponentDefinition(oPDoc.ComponentDefinition, oMatrix)
	Next
Next

'Close the Workbook (file)
oWB.Close
'Close this instance of the Excel application
oExcelApp.Quit
End Sub

Function GetExcelFile() As String
	Dim oFileName As String
	Dim oOpenDlg As New System.Windows.Forms.OpenFileDialog
	oOpenDlg.Title = "Browse To And Select Your Excel File."
	oOpenDlg.InitialDirectory = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath
	oOpenDlg.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx"
	oOpenDlg.Multiselect = False
	oOpenDlg.RestoreDirectory = False
	Dim oResult = oOpenDlg.ShowDialog
	If oResult = vbOK Then
		If oOpenDlg.FileName &amp;lt;&amp;gt; vbNullString Then
			oFileName = oOpenDlg.FileName
		Else
			MsgBox("No file was selected. Exiting.", vbOKOnly + vbExclamation, "FILE NOT SELECTED")
		End If
	ElseIf oResult = vbCancel Then
		MsgBox("The dialog was Canceled. Exiting.", vbOKOnly + vbInformation, "CANCELED")
	End If
	GetExcelFile = oFileName
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank" rel="noopener"&gt;My IDEAS &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank" rel="noopener"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/" target="_blank" rel="noopener"&gt;Inventor 2021 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank" rel="noopener"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank" rel="noopener"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank" rel="noopener"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 18:30:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9851037#M117829</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-11-06T18:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9855056#M117853</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Thank you so much, WCrihfield&lt;/SPAN&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am quite sure your code is the solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But unfortunately the code is not working for me, yet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There comes an error right in the beginning after selecting the excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it might be because I have a German Excel version.&lt;/P&gt;&lt;P&gt;In my test.xlsx file I renamed the sheet from “Tabelle1” to “Sheet1”, so I had no problem because of language version in the rule that creates virtual parts.&lt;/P&gt;&lt;P&gt;But maybe this rule uses more excel…&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="Jakob_Hamburg_0-1604904104206.jpeg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/841920i7245CA37B1C5FF97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jakob_Hamburg_0-1604904104206.jpeg" alt="Jakob_Hamburg_0-1604904104206.jpeg" /&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;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jakob_Hamburg_1-1604904104211.jpeg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/841919i2EB85B7CFEB4B561/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jakob_Hamburg_1-1604904104211.jpeg" alt="Jakob_Hamburg_1-1604904104211.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try the code on a computer with english version of excel hopefully soon.&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>Mon, 09 Nov 2020 07:04:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9855056#M117853</guid>
      <dc:creator>Jakob_Hamburg</dc:creator>
      <dc:date>2020-11-09T07:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9855519#M117864</link>
      <description>&lt;P&gt;Sorry for false alarm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is no error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just had an empty excel cell in my test file. that empty cell caused the problems.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 10:57:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9855519#M117864</guid>
      <dc:creator>Jakob_Hamburg</dc:creator>
      <dc:date>2020-11-09T10:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9858160#M117911</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This might be interesting for people who are using a Vault and want to use the above rule with numbering scheme from Vault:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added some code to the rule, so the automatically created files are saved with filenames according to a vault numbering scheme.&lt;/P&gt;&lt;P&gt;(The rule above uses filenames from the excel sheet.)&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;AddReference "Microsoft.Office.Interop.Excel.dll"
Imports Microsoft.Office.Interop.Excel
AddReference "Autodesk.Connectivity.WebServices"
AddReference "Autodesk.DataManagement.Client.Framework.Forms"
AddReference "Autodesk.DataManagement.Client.Framework.Vault"
AddReference "Autodesk.DataManagement.Client.Framework.Vault.Forms"
AddReference "Connectivity.InventorAddin.EdmAddin"
Imports ACW = Autodesk.Connectivity.WebServices
Imports VDF = Autodesk.DataManagement.Client.Framework
Imports Autodesk.DataManagement.Client.Framework.Vault.Services
Imports Autodesk.DataManagement.Client.Framework.Vault.Currency.Connections
Imports edm = Connectivity.InventorAddin.EdmAddin&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;Sub Main
'Specify the Excel file's (Workbook) full path &amp;amp; file name (with extension)
'It is calling a Windows OpenFileDialog to allow the user to do this
Dim oFileName As String = GetExcelFile()
'Specify the Sheet name within the workbook
'perhaps this name could be selected from a list of all available sheets
'in the Excel Workbook once opened, of you don't want to manually specify it here?
Dim oSheetName As String = "Sheet1"

'Start a new instance of the Excel application
Dim oExcelApp As Microsoft.Office.Interop.Excel.Application
oExcelApp = New Microsoft.Office.Interop.Excel.ApplicationClass
oExcelApp.DisplayAlerts = False
oExcelApp.Visible = False

'[ Attempt to open the specified Workbook (file) using the supplied file name
Dim oWB As Workbook
Try
	oWB = oExcelApp.Workbooks.Open(oFileName)
Catch oEx As Exception
	MsgBox("The attempt to open the Excel file named '" &amp;amp; oFileName &amp;amp; "' failed." &amp;amp; vbCrLf &amp;amp; _
	"The error message for this failure is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.Message &amp;amp; vbCrLf &amp;amp;  vbCrLf &amp;amp; _
	"Its 'StackTrace is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.StackTrace &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _
	"Its source is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.Source, vbOKOnly + vbCritical, "Couldn't Open File")
	Exit Sub
End Try
'Attempt to get the Worksheet
Dim oWS As Worksheet
Try
	oWS = oWB.Sheets.Item(oSheetName)
Catch
	oWS = oWB.ActiveSheet
Catch
	oWS = oWB.Worksheets.Item(1)
Catch
	MsgBox("No Worksheet was found in the specified Excel file. Exiting.", vbOKOnly + vbCritical, " ")
	Exit Sub
End Try

Dim oCells As Range = oWS.Cells

'Define the active Assembly and all related variables
If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kAssemblyDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Assembly Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisAssembly.Document
Dim oDir As String = System.IO.Path.GetDirectoryName(oADoc.FullFileName)
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oOccs As ComponentOccurrences = oADef.Occurrences
Dim oOcc As ComponentOccurrence
Dim oPDoc As PartDocument
Dim oDProps As Inventor.PropertySet 'Design Tracking Properties (Project)
Dim oSProps As Inventor.PropertySet 'Inventor Summary Information (Summary)
Dim oMatrix As Inventor.Matrix = ThisApplication.TransientGeometry.CreateMatrix

'Find the last row and last column being used to limit our loop ranges
Dim oLastRow As Integer = oWS.UsedRange.Rows.Count
'Dim oLastCol As Integer = oWS.UsedRange.Columns.Count
'Dim oColumnHeadersRow As Integer = 1
Dim o1stDataRow As Integer = 2
Dim oRow, oQty As Integer
Dim oPName, oPNum, oVendor, oNotes As String
Dim oPFilename As String

For oRow = o1stDataRow To oLastRow
	'First number is Row index, second number is Column Index
	oQty = oCells.Item(oRow, 1).Value
	oPName = oCells.Item(oRow, 2).Value
	oPNum = oCells.Item(oRow, 3).Value
	oVendor = oCells.Item(oRow, 4).Value
	oNotes = oCells.Item(oRow, 5).Value
	
	'Create the new Part
	oPDoc = ThisApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject, , False)
	'Set the iProperties within the new Part
	oDProps = oPDoc.PropertySets.Item("Design Tracking Properties")
	oSProps = oPDoc.PropertySets.Item("Inventor Summary Information")
	oDProps.Item("Description").Value = oPName
	oDProps.Item("Part Number").Value = oPNum
	oDProps.Item("Vendor").Value = oVendor
	oSProps.Item("Comments").Value = oNotes
	
	'&amp;lt;&amp;lt;&amp;lt;&amp;lt; !!! CHECK IF THIS IS OK BEFORE RUNNING !!! &amp;gt;&amp;gt;&amp;gt;&amp;gt;
	'Saving each new Part to the same directory as the Assembly
	'if this is not OK, you could specify a different directory
	'or you could use a SaveFileDialog for this
	'or just skip saving the parts at this stage altogether
	oPFilename = getFilenamesFromVaultNamingScheme("CT", "", 1)
	'note: CT is the name of my numbering scheme in vault has to be adjusted to personal needs!!
	'oPDoc.SaveAs(oDir &amp;amp; "\" &amp;amp; oPName &amp;amp; ".ipt", False)
	oPDoc.SaveAs(oDir &amp;amp; "\" &amp;amp; oPFilename &amp;amp; ".ipt", False)
	
	'Add that many of this part to the assembly
	For i = 1 To oQty
		oOccs.AddByComponentDefinition(oPDoc.ComponentDefinition, oMatrix)
	Next
Next

'Close the Workbook (file)
oWB.Close
'Close this instance of the Excel application
oExcelApp.Quit
End Sub

Function GetExcelFile() As String
	Dim oFileName As String
	Dim oOpenDlg As New System.Windows.Forms.OpenFileDialog
	oOpenDlg.Title = "Browse To And Select Your Excel File."
	oOpenDlg.InitialDirectory = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath
	oOpenDlg.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx"
	oOpenDlg.Multiselect = False
	oOpenDlg.RestoreDirectory = False
	Dim oResult = oOpenDlg.ShowDialog
	If oResult = vbOK Then
		If oOpenDlg.FileName &amp;lt;&amp;gt; vbNullString Then
			oFileName = oOpenDlg.FileName
		Else
			MsgBox("No file was selected. Exiting.", vbOKOnly + vbExclamation, "FILE NOT SELECTED")
		End If
	ElseIf oResult = vbCancel Then
		MsgBox("The dialog was Canceled. Exiting.", vbOKOnly + vbInformation, "CANCELED")
	End If
	GetExcelFile = oFileName
End Function


Function getFilenamesFromVaultNamingScheme(RequiredSchemeName As String, RequiredSchemeString As String, numberOfNames As Integer)
Dim oPFilename As String
Dim Connection As VDF.Vault.Currency.Connections.Connection = edm.EdmSecurity.Instance.VaultConnection()
Dim genNum As String = String.Empty

If Not Connection Is Nothing Then
Dim entityClassId = VDF.Vault.Currency.Entities.EntityClassIds.Files
Dim numSchemes As ACW.NumSchm() = Connection.WebServiceManager.NumberingService.GetNumberingSchemes(entityClassId, Nothing) 'kanske inte nothing
Dim requiredScheme As ACW.NumSchm = (From sch As ACW.NumSchm In numSchemes
Where sch.Name = RequiredSchemeName
Select sch).FirstOrDefault()
Dim numGenArgs() As String = {RequiredSchemeString }

	
	oPFilename = Connection.WebServiceManager.DocumentService.GenerateFileNumber(requiredScheme.SchmID, numGenArgs)

'MessageBox.Show("Numbers generated: " &amp;amp; oPFilename &amp;amp; " to ", "Success!", _
'MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("Vault didn't work", "Fail!", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End If 
getFilenamesFromVaultNamingScheme = oPFilename
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the code for the vault numbering scheme from here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/create-parts-and-save-using-vault-numbering-scheme/td-p/9821010" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/inventor-customization/create-parts-and-save-using-vault-numbering-scheme/td-p/9821010&lt;/A&gt;&lt;/P&gt;&lt;P&gt;so thanks to&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176" target="_self"&gt;&lt;SPAN class="login-bold"&gt;JhoelForshav&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 09:44:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/9858160#M117911</guid>
      <dc:creator>Jakob_Hamburg</dc:creator>
      <dc:date>2020-11-10T09:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10454204#M126272</link>
      <description>&lt;P&gt;Hi I have this working on my pc but when I get one of the other people in the office to run it, it troughs up and error and I can't work out why. Can you please point me in the right direction?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;System.InvalidCastException: Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type 'Microsoft.Office.Interop.Excel._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Element not found. (Exception from HRESULT: 0x8002802B (TYPE_E_ELEMENTNOTFOUND)).&lt;BR /&gt;at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr&amp;amp; ppTarget, Boolean&amp;amp; pfNeedsRelease)&lt;BR /&gt;at Microsoft.Office.Interop.Excel.ApplicationClass.set_DisplayAlerts(Boolean RHS)&lt;BR /&gt;at ThisRule.Main()&lt;BR /&gt;at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It fails at this point.&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'Start a new instance of the Excel application
Dim oExcelApp As Microsoft.Office.Interop.Excel.Application
oExcelApp = New Microsoft.Office.Interop.Excel.ApplicationClass
'Fails here
oExcelApp.DisplayAlerts = False
oExcelApp.Visible = False&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also modified it to show a message box that explains how the excel doc needs to be set out, use a specific template, use part number as file name and ground the parts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'Source "https://forums.autodesk.com/t5/inventor-customization/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/td-p/9850027"

AddReference "Microsoft.Office.Interop.Excel.dll"
Imports Microsoft.Office.Interop.Excel

Sub Main
		MessageBox.Show("Excel sheet needs to have the following columns in row 1 in order to populate the properites" &amp;amp; vbCrLf &amp;amp; _
		"'Qty' (by ea units only not length), 'Description','Part Number', 'Vendor', 'Stock Number'" &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp;  _
		 "Assembly needs to be saved", "Rule Requirements")
'Specify the Excel file's (Workbook) full path &amp;amp; file name (with extension)
'It is calling a Windows OpenFileDialog to allow the user to do this
Dim oFileName As String = GetExcelFile()
'Specify the Sheet name within the workbook
'perhaps this name could be selected from a list of all available sheets
'in the Excel Workbook once opened, of you don't want to manually specify it here?
Dim oSheetName As String = "Sheet1"

'Start a new instance of the Excel application
Dim oExcelApp As Microsoft.Office.Interop.Excel.Application
oExcelApp = New Microsoft.Office.Interop.Excel.ApplicationClass
oExcelApp.DisplayAlerts = False
oExcelApp.Visible = False

'[ Attempt to open the specified Workbook (file) using the supplied file name
Dim oWB As Workbook
Try
	oWB = oExcelApp.Workbooks.Open(oFileName)
Catch oEx As Exception
	MsgBox("The attempt to open the Excel file named '" &amp;amp; oFileName &amp;amp; "' failed." &amp;amp; vbCrLf &amp;amp; _
	"The error message for this failure is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.Message &amp;amp; vbCrLf &amp;amp;  vbCrLf &amp;amp; _
	"Its 'StackTrace is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.StackTrace &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _
	"Its source is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.Source, vbOKOnly + vbCritical, "Couldn't Open File")
	Exit Sub
End Try
'Attempt to get the Worksheet
Dim oWS As Worksheet
Try
	oWS = oWB.Sheets.Item(oSheetName)
Catch
	oWS = oWB.ActiveSheet

Catch
	oWS = oWB.Worksheets.Item(1)
Catch

	MsgBox("'Sheet 1' Worksheet was not found in the specified Excel file. Exiting.", vbOKOnly + vbCritical, " ")
	Exit Sub
End Try

Dim oCells As Range = oWS.Cells
'Define the active Assembly and all related variables
If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kAssemblyDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Assembly Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Exit Sub
End If

Dim oADoc As AssemblyDocument = ThisAssembly.Document
Dim oDir As String = System.IO.Path.GetDirectoryName(oADoc.FullFileName)
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oOccs As ComponentOccurrences = oADef.Occurrences
Dim oOcc As ComponentOccurrence
Dim oPDoc As PartDocument
Dim oDProps As Inventor.PropertySet 'Design Tracking Properties (Project)
Dim oSProps As Inventor.PropertySet 'Inventor Summary Information (Summary)
Dim oMatrix As Inventor.Matrix = ThisApplication.TransientGeometry.CreateMatrix

'Find the last row and last column being used to limit our loop ranges
Dim oLastRow As Integer = oWS.UsedRange.Rows.Count
'Dim oLastCol As Integer = oWS.UsedRange.Columns.Count
'Dim oColumnHeadersRow As Integer = 1
Dim o1stDataRow As Integer = 2
Dim oRow, oQty As Integer
Dim oPName, oPNum, oVendor, oStock As String

For oRow = o1stDataRow To oLastRow
	'First number is Row index, second number is Column Index
	oQty = oCells.Item(oRow, 1).Value
	oPName = oCells.Item(oRow, 2).Value
	oPNum = oCells.Item(oRow, 3).Value
	oVendor = oCells.Item(oRow, 4).Value
	oStock = oCells.Item(oRow, 5).Value

	'Define part template
	oTemplate=ThisApplication.DesignProjectManager.ActiveDesignProject.TemplatesPath &amp;amp; "\Emtpy part for BOM.ipt"
	'Create the new Part
	oPDoc = ThisApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject,oTemplate , False)
	'Set the iProperties within the new Part
	oDProps = oPDoc.PropertySets.Item("Design Tracking Properties")
	oSProps = oPDoc.PropertySets.Item("Inventor Summary Information")
	oDProps.Item("Description").Value = oPName
	oDProps.Item("Part Number").Value = oPNum
	oDProps.Item("Vendor").Value = oVendor
	oDProps.Item("Stock Number").Value = oStock

	'&amp;lt;&amp;lt;&amp;lt;&amp;lt; !!! CHECK IF THIS IS OK BEFORE RUNNING !!! &amp;gt;&amp;gt;&amp;gt;&amp;gt;
	'Saving each new Part to the same directory as the Assembly
	'if this is not OK, you could specify a different directory
	'or you could use a SaveFileDialog for this
	'or just skip saving the parts at this stage altogether
	oPDoc.SaveAs(oDir &amp;amp; "\" &amp;amp; oPNum &amp;amp; ".ipt", False)
							
	'Add that many of this part to the assembly
	For i = 1 To oQty
'		oOccs.AddByComponentDefinition(oPDoc.ComponentDefinition, oMatrix)
		oOcc = oOccs.AddByComponentDefinition(oPDoc.ComponentDefinition, oMatrix)
		oOcc.Grounded = True

	Next
Next

'Close the Workbook (file)
oWB.Close
'Close this instance of the Excel application
oExcelApp.Quit
End Sub

Function GetExcelFile() As String
	Dim oFileName As String
	Dim oOpenDlg As New System.Windows.Forms.OpenFileDialog
	oOpenDlg.Title = "Browse To And Select Your Excel File."
	oOpenDlg.InitialDirectory = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath
	oOpenDlg.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx"
	oOpenDlg.Multiselect = False
	oOpenDlg.RestoreDirectory = False
	Dim oResult = oOpenDlg.ShowDialog
	If oResult = vbOK Then
		If oOpenDlg.FileName &amp;lt;&amp;gt; vbNullString Then
			oFileName = oOpenDlg.FileName
		Else
			MsgBox("No file was selected. Exiting.", vbOKOnly + vbExclamation, "FILE NOT SELECTED")
		End If
	ElseIf oResult = vbCancel Then
		MsgBox("The dialog was Canceled. Exiting.", vbOKOnly + vbInformation, "CANCELED")
	End If
	GetExcelFile = oFileName
End Function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 00:01:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10454204#M126272</guid>
      <dc:creator>terry.nicholls</dc:creator>
      <dc:date>2021-07-09T00:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10454569#M126274</link>
      <description>&lt;P&gt;Hi Terry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sorry, but I cannot help you.&lt;/P&gt;&lt;P&gt;I assume you are trying to read from the same excel file on your own computer and on your colleagues, so there will be no issue in that.&lt;/P&gt;&lt;P&gt;Are your computers same?&lt;/P&gt;&lt;P&gt;If you google&amp;nbsp; for your error message it says it is an MS office/excel Problem and you might try to reinstall/repair&amp;nbsp;&amp;nbsp;MS office/excel.&lt;/P&gt;&lt;P&gt;sounds strange, but maybe you can give it a try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see also&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/ilogic-error-using-embedded-excel-table-inventor-2020-3/m-p/9511985#M110731" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/ilogic-error-using-embedded-excel-table-inventor-2020-3/m-p/9511985#M110731&lt;/A&gt;&lt;/P&gt;&lt;P&gt;to see that sometimes error will be solved by&amp;nbsp;reinstall/repair&amp;nbsp;&amp;nbsp;MS office/excel.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 04:19:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10454569#M126274</guid>
      <dc:creator>Jakob_Hamburg</dc:creator>
      <dc:date>2021-07-09T04:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10454588#M126275</link>
      <description>Hi, thanks for getting back to me. Yes different computers with different xls files on own machines. We came across the same suggestion so will look into it on Monday.&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Jul 2021 04:35:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10454588#M126275</guid>
      <dc:creator>terry.nicholls</dc:creator>
      <dc:date>2021-07-09T04:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10454596#M126276</link>
      <description>ok.&lt;BR /&gt;just keep in mind to not have any empty cells in your excel file.&lt;BR /&gt;that illogic code doesn’t like empty cell&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Jul 2021 04:42:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10454596#M126276</guid>
      <dc:creator>Jakob_Hamburg</dc:creator>
      <dc:date>2021-07-09T04:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10455734#M126295</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7084602"&gt;@terry.nicholls&lt;/a&gt; .&lt;/P&gt;
&lt;P&gt;There are several ways to start up the Excel application, open Excel documents, and work with Excel in general.&amp;nbsp; In the case of that rule, it seems I chose the following lines to start the Excel application and assign it to a variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oExcelApp As Microsoft.Office.Interop.Excel.Application
oExcelApp = New Microsoft.Office.Interop.Excel.ApplicationClass&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The simplest change I might suggest is to change 'ApplicationClass' to 'Application' at the end of that second line like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oExcelApp As Microsoft.Office.Interop.Excel.Application
oExcelApp = New Microsoft.Office.Interop.Excel.Application&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those ways will always attempt to create a new instance of Excel, whether it is currently running or not.&lt;/P&gt;
&lt;P&gt;Or, there are other options too.&amp;nbsp; One option would be to simply use the GetObject() &amp;amp;/or CreateObject() methods like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oExcel As Microsoft.Office.Interop.Excel.Application
Try
	'try to find an already running instance of the Excel Application
	oExcel = GetObject(, "Excel.Application")
	MsgBox("Found an instance of the Excel Application already open.",,"")
Catch
	'it wasn't found open, so create an instance of it (start the application)
	oExcel = CreateObject("Excel.Application") 'Option 1
	MsgBox("Created a new instance of the Excel Application.", , "")
Catch
	MsgBox("Failed to Get/Create an instance of the Excel Application. Exiting.", , "")
	Exit Sub
End Try&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;And if you are just doing something simple from an iLogic rule, you could just use the built-in 'GoExcel' tools, shown within the iLogic Rule Editor's Snippets &amp;gt; System tab &amp;gt; Excel Data Links group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as the empty cell issue, that can be annoying, but can be dealt with.&amp;nbsp; You can either attempt to check the cell's value, without specifying expected data type, or you can use Cast (direct data type conversion) methods to ensure that the returned value is being understood as the data type you are expecting.&amp;nbsp; Cell values can be many types of data, therefore the 'Value' is defined as Variant (or Object) instead of a specific data type.&amp;nbsp; Therefore it can be a little tricky when attempting to set a cell's value directly to a variable of a certain type.&amp;nbsp; If you are expecting the value to be a String type data, you can have a String type variable, then when attempting to set its value from the oCells.Item().Value you can use the oPName = CStr(oCells.Item().Value), which will attempt to directly convert the cell's value to a String type before setting it as the value of the variable.&amp;nbsp; Another convenient tool to check for an empty cell is something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;If String.IsNullOrEmpty(oCells.Item().Value) Then
'or
If Not String.IsNullOrEmpty(oCells.Item().Value) Then&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;If you want and have time, I would appreciate your Vote(s) for &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank" rel="noopener"&gt;My IDEAS &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;or you can Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank" rel="noopener"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 13:32:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/10455734#M126295</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-07-09T13:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207492#M157062</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need urgently the code for Inventor 2021 - I get here constantly the error message " Error Invalid Path" - can someone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;AddReference "Microsoft.Office.Interop.Excel.dll"
Imports Microsoft.Office.Interop.Excel
Sub Main
'Specify the Excel file's (Workbook) full path &amp;amp; file name (with extension)
'It is calling a Windows OpenFileDialog to allow the user to do this
Dim oFileName As String = GetExcelFile()
'Specify the Sheet name within the workbook
'perhaps this name could be selected from a list of all available sheets
'in the Excel Workbook once opened, of you don't want to manually specify it here?
Dim oSheetName As String = "Sheet1"

'Start a new instance of the Excel application
Dim oExcelApp As Microsoft.Office.Interop.Excel.Application
oExcelApp = New Microsoft.Office.Interop.Excel.ApplicationClass
oExcelApp.DisplayAlerts = False
oExcelApp.Visible = False

'[ Attempt to open the specified Workbook (file) using the supplied file name
Dim oWB As Workbook
Try
	oWB = oExcelApp.Workbooks.Open(oFileName)
Catch oEx As Exception
	MsgBox("The attempt to open the Excel file named '" &amp;amp; oFileName &amp;amp; "' failed." &amp;amp; vbCrLf &amp;amp; _
	"The error message for this failure is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.Message &amp;amp; vbCrLf &amp;amp;  vbCrLf &amp;amp; _
	"Its 'StackTrace is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.StackTrace &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _
	"Its source is as follows:" &amp;amp; vbCrLf &amp;amp; _
	oEx.Source, vbOKOnly + vbCritical, "Couldn't Open File")
	Exit Sub
End Try
'Attempt to get the Worksheet
Dim oWS As Worksheet
Try
	oWS = oWB.Sheets.Item(oSheetName)
Catch
	oWS = oWB.ActiveSheet
Catch
	oWS = oWB.Worksheets.Item(1)
Catch
	MsgBox("No Worksheet was found in the specified Excel file. Exiting.", vbOKOnly + vbCritical, " ")
	Exit Sub
End Try

Dim oCells As Range = oWS.Cells

'Define the active Assembly and all related variables
If ThisApplication.ActiveDocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kAssemblyDocumentObject Then
	MsgBox("This rule '" &amp;amp; iLogicVb.RuleName &amp;amp; "' only works for Assembly Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisAssembly.Document
Dim oDir As String = System.IO.Path.GetDirectoryName(oADoc.FullFileName)
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oOccs As ComponentOccurrences = oADef.Occurrences
Dim oOcc As ComponentOccurrence
Dim oPDoc As PartDocument
Dim oDProps As Inventor.PropertySet 'Design Tracking Properties (Project)
Dim oSProps As Inventor.PropertySet 'Inventor Summary Information (Summary)
Dim oMatrix As Inventor.Matrix = ThisApplication.TransientGeometry.CreateMatrix

'Find the last row and last column being used to limit our loop ranges
Dim oLastRow As Integer = oWS.UsedRange.Rows.Count
'Dim oLastCol As Integer = oWS.UsedRange.Columns.Count
'Dim oColumnHeadersRow As Integer = 1
Dim o1stDataRow As Integer = 2
Dim oRow, oQty As Integer
Dim oPName, oPNum, oVendor, oNotes As String

For oRow = o1stDataRow To oLastRow
	'First number is Row index, second number is Column Index
	oQty = oCells.Item(oRow, 1).Value
	oPName = oCells.Item(oRow, 2).Value
	oPNum = oCells.Item(oRow, 3).Value
	oVendor = oCells.Item(oRow, 4).Value
	oNotes = oCells.Item(oRow, 5).Value
	
	'Create the new Part
	oPDoc = ThisApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject, , False)
	'Set the iProperties within the new Part
	oDProps = oPDoc.PropertySets.Item("Design Tracking Properties")
	oSProps = oPDoc.PropertySets.Item("Inventor Summary Information")
	oDProps.Item("Description").Value = oPName
	oDProps.Item("Part Number").Value = oPNum
	oDProps.Item("Vendor").Value = oVendor
	oSProps.Item("Comments").Value = oNotes
	
	'&amp;lt;&amp;lt;&amp;lt;&amp;lt; !!! CHECK IF THIS IS OK BEFORE RUNNING !!! &amp;gt;&amp;gt;&amp;gt;&amp;gt;
	'Saving each new Part to the same directory as the Assembly
	'if this is not OK, you could specify a different directory
	'or you could use a SaveFileDialog for this
	'or just skip saving the parts at this stage altogether
	oPDoc.SaveAs(oDir &amp;amp; "\" &amp;amp; oPName &amp;amp; ".ipt", False)
	
	'Add that many of this part to the assembly
	For i = 1 To oQty
		oOccs.AddByComponentDefinition(oPDoc.ComponentDefinition, oMatrix)
	Next
Next

'Close the Workbook (file)
oWB.Close
'Close this instance of the Excel application
oExcelApp.Quit
End Sub

Function GetExcelFile() As String
	Dim oFileName As String
	Dim oOpenDlg As New System.Windows.Forms.OpenFileDialog
	oOpenDlg.Title = "Browse To And Select Your Excel File."
	oOpenDlg.InitialDirectory = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath
	oOpenDlg.Filter = "Excel Files (*.xls;*.xlsx)|*.xls;*.xlsx"
	oOpenDlg.Multiselect = False
	oOpenDlg.RestoreDirectory = False
	Dim oResult = oOpenDlg.ShowDialog
	If oResult = vbOK Then
		If oOpenDlg.FileName &amp;lt;&amp;gt; vbNullString Then
			oFileName = oOpenDlg.FileName
		Else
			MsgBox("No file was selected. Exiting.", vbOKOnly + vbExclamation, "FILE NOT SELECTED")
		End If
	ElseIf oResult = vbCancel Then
		MsgBox("The dialog was Canceled. Exiting.", vbOKOnly + vbInformation, "CANCELED")
	End If
	GetExcelFile = oFileName
End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 17:08:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207492#M157062</guid>
      <dc:creator>max.baumann07</dc:creator>
      <dc:date>2023-08-30T17:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207604#M157065</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11294101"&gt;@max.baumann07&lt;/a&gt;.&amp;nbsp; Does the error message indicate which line within the code that is encountering the error.&amp;nbsp; I only see two places where a 'path' is being specified.&amp;nbsp; At the beginning, where you browse for the excel file, then try to open that Excel file, then later where you are specifying the SaveAs path, using oDir &amp;amp; oPName variables.&amp;nbsp; If the assembly had not been saved yet, then you will not get the needed path data when setting the value of the oDir variable.&amp;nbsp; If that cell you are specifying within the Excel sheet is empty, or maybe if the cell is formatted as something other than text, you may be getting bad data from that cell to set as the value of oPName variable.&amp;nbsp; Maybe try using a Logger.Info() or MsgBox, or MessageBox.Show() to show/record what full file name you end up with before trying the SaveAs line.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 17:49:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207604#M157065</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-08-30T17:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207650#M157067</link>
      <description>&lt;P&gt;First, thank you for your quick reply.&lt;BR /&gt;I had indeed not formatted the cells as text, nor was the excel in the same working directory. However, I have now further a problem and come unfortunately not at all further.&lt;BR /&gt;&lt;BR /&gt;Test Excel:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maxbaumann07_0-1693418864451.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1260101iA9474A8CCC0253D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maxbaumann07_0-1693418864451.png" alt="maxbaumann07_0-1693418864451.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maxbaumann07_1-1693418892692.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1260102i7B024846105FDFF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maxbaumann07_1-1693418892692.png" alt="maxbaumann07_1-1693418892692.png" /&gt;&lt;/span&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="maxbaumann07_2-1693418911290.png" style="width: 952px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1260103iD8B510009BF87023/image-dimensions/952x156?v=v2" width="952" height="156" role="button" title="maxbaumann07_2-1693418911290.png" alt="maxbaumann07_2-1693418911290.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 18:08:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207650#M157067</guid>
      <dc:creator>max.baumann07</dc:creator>
      <dc:date>2023-08-30T18:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207677#M157070</link>
      <description>&lt;P&gt;Besides what I mentioned above, another thing that might be causing problems is if a file with that same name already exists in that same folder.&amp;nbsp; I don't know if your system will just let you overwrite it, without any prompt or not, especially if that file may be open or ReadOnly for some reason.&amp;nbsp; Do you have full Read/Write permission in that directory? Try adding some lines of code like the following before your SaveAs line of code.&lt;/P&gt;
&lt;P&gt;Dim sFFN As String =&amp;nbsp;oDir &amp;amp; "\" &amp;amp; oPName &amp;amp; ".ipt"&lt;/P&gt;
&lt;P&gt;Logger.Info("SaveAs FullFileName = " &amp;amp; sFFN )&lt;/P&gt;
&lt;P&gt;If System.IO.File.Exists(sFFN) Then 'show a message to the user, or skip this one, or do something different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 18:22:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207677#M157070</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-08-30T18:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207760#M157074</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GREAT. Thank you!&lt;/P&gt;&lt;P&gt;This works.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However, I still have a small question. When I want als to create Custom iPropertys. What am I doing wrong?&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="maxbaumann07_0-1693421805683.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1260122i5B3EAD9685C46043/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maxbaumann07_0-1693421805683.png" alt="maxbaumann07_0-1693421805683.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 18:59:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207760#M157074</guid>
      <dc:creator>max.baumann07</dc:creator>
      <dc:date>2023-08-30T18:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207789#M157076</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11294101"&gt;@max.baumann07&lt;/a&gt;.&amp;nbsp; That 'iProperties.Value()' iLogic shortcut snippet does not know which specific document to target.&amp;nbsp; There are ways to add a third input into it, as its first input, in an attempt to tell it which document to target, but they are not always that great (&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=b381af75-8b28-1048-7424-3942a74a1054" target="_blank" rel="noopener"&gt;Link1&lt;/A&gt;, &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=b564517a-f5cc-805f-0628-7a6e3ea65507" target="_blank" rel="noopener"&gt;Link2&lt;/A&gt;).&amp;nbsp; If you want it to target a specific 'component' in an assembly, you can supply the ComponentOccurrence.Name value (as String) as the first (of 3) inputs.&amp;nbsp; If targeting a referenced document, instead of a component, you can usually supply the Document.DisplayName value there, but that doesn't always work good either.&amp;nbsp; The best way may be to do it the API way&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Document.PropertySets.Item(4).Item("CustomPropertyName").Value = &lt;/LI-CODE&gt;
&lt;P&gt;but that will not create the property, if it does not already exist.&amp;nbsp; You would have to use a Try...Catch block, where you try to access that property and/or set its value in the Try side, and if that fails, try to create it in the Catch side, and set its value there, as you create it.&amp;nbsp; I'm using Index 4, because the 'custom' property set is always the fourth one.&amp;nbsp; The PropertySet object has a method for creating a new property.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 19:14:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12207789#M157076</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-08-30T19:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12208697#M157090</link>
      <description>&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried, but unfortunately I can't get it to work.&lt;/P&gt;&lt;P&gt;Row 1 are supposed to be custom iPropertys and always use the changing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you maybe create me again a code for this "that I can just paste"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That would be great, because I absolutely can not figure out what I'm doing wrong.&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="maxbaumann07_0-1693463461235.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1260270i3E731EB9C0E3502A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maxbaumann07_0-1693463461235.png" alt="maxbaumann07_0-1693463461235.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 06:32:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12208697#M157090</guid>
      <dc:creator>max.baumann07</dc:creator>
      <dc:date>2023-08-31T06:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Ilogic create “empty parts“ and fill their iProperties from excel</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12210215#M157139</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11294101"&gt;@max.baumann07&lt;/a&gt;.&amp;nbsp; Busy day today, but I made an attempt at editing the last full code you posted above, and added the stuff from the screen captured image too.&amp;nbsp; Not sure if I fixed anything yet though, because I don't have your file set, but I attached the code as a text file for you to review.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 17:57:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-create-empty-parts-and-fill-their-iproperties-from-excel/m-p/12210215#M157139</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-08-31T17:57:18Z</dc:date>
    </item>
  </channel>
</rss>

