Hi @kurs-autodesk. The sample file you attached confused me, because it seems to be a DXF instead of an Inventor document. Anyways, I think I may have an iLogic rule you could use on in that assembly, which will loop through each part type component within, get the part's name (from file name), attempts to retrieve the two values from the Excel file (correct file name needs to be specified), using that name to find the right row. Then it tries to set those two values as the values of the two parameters within the part. Then updates and saves each part after parameter values are changed. Then when done, updates the main assembly.
It's a somewhat complex task, so the code is a bit complex looking too. You will need to change the name of the Excel file and/or sheet it is looking for within the code.
Sub Main
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
MsgBox("An Assembly Document must be active for this rule to work. Exiting.",vbCritical, "WRONG DOCUMENT TYPE")
Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
For Each oOcc As ComponentOccurrence In oADef.Occurrences
Dim oA, oB As Double
GetParamValsFromExcel(oOcc, oA, oB)
SetOccParamVal(oOcc, "A", oA, "B", oB)
Next
oADoc.Update2(True)
End Sub
'oA and oB are passed in, given values, then passed back out with those values in place
Sub GetParamValsFromExcel(oComp As ComponentOccurrence, ByRef oA As Double, ByRef oB As Double)
If Not TypeOf oComp.Definition Is PartComponentDefinition Then Exit Sub
Dim oPDoc As PartDocument = oComp.Definition.Document
Dim oName As String = System.IO.Path.GetFileNameWithoutExtension(oPDoc.FullFileName)
Dim oExcelFile As String = "C:\Temp\MyExcelFile.xlsx" '<<< CHANGE THIS >>>
Dim oSheetName As String = "Sheet1"
GoExcel.Open(oExcelFile, oSheetName)
GoExcel.TitleRow = 1
GoExcel.FindRowStart = 2
Dim oRow As Integer = GoExcel.FindRow(oExcelFile, oSheetName, "Name", "=", oName)
oA = GoExcel.CellValue("B" & oRow)
oB = GoExcel.CellValue("C" & oRow)
End Sub
Sub SetOccParamVal(oComp As ComponentOccurrence, oP1Name As String, oP1Val As Double, oP2Name As String, oP2Val As Double)
If Not TypeOf oComp.Definition Is PartComponentDefinition Then Exit Sub
Dim oPDef As PartComponentDefinition = oComp.Definition
For Each oParam As Inventor.Parameter In oPDef.Parameters
If oParam.Name = oP1Name Then
oParam.Value = oP1Val
ElseIf oParam.Name = oP2Name Then
oParam.Value = oP2Val
End If
Next
Dim oPDoc As PartDocument = oPDef.Document
oPDoc.Update2(True)
oPDoc.Save
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)