Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to grab parameters from a spreadsheet to generate parts (similar to an i-part but without the link to the base part).
I have got it to grab the parameters I add to the sheet, but it is also assigning values to parameters that are not in the spreadsheet? seems to default to the first cell. How do I stop this behavior?
Incorrect values:
Is there a way to tell it to only grab parameters that exist in the spreadsheet that match the model parameters?
Current code:
'sets multivalue list of all model parameters ModParams = ThisDoc.Document.ComponentDefinition.Parameters.ModelParameters 'sets associated Excell file, Passes user text for file name: ExcelFile = "C:\CHS\Small Cell\" & Exc_file & ".xls" 'Passes user text for coloumn name containing values: Col = Col_Name 'Passes user text for sheet name: ExSheet = Excell_Sheet 'opens the excell file GoExcel.Open(Exc_file, ExSheet) 'sets where to find the title row GoExcel.TitleRow = 1 'cycle through all numerical model parameters And Do a thing. For Each oParam In ModParams If oParam.Units <> "Text" And oParam.Units <> "Boolean" Then ParameterName = oParam.Name 'find in spreadsheet Row matching the inventor parameter name Ex_Parameter_Name = GoExcel.FindRow(ExcelFile, ExSheet, "Parameter", "=", ParameterName) 'get the value from user specified coloumn value = GoExcel.CurrentRowValue(Col) Parameter(ParameterName) = value End If Next GoExcel.Close InventorVb.DocumentUpdate()
Example of parameters I want to grab:
Solved! Go to Solution.