Need some help getting parameters in an Excel file into Assembly part parameters

Need some help getting parameters in an Excel file into Assembly part parameters

matthew_neesley
Collaborator Collaborator
457 Views
3 Replies
Message 1 of 4

Need some help getting parameters in an Excel file into Assembly part parameters

matthew_neesley
Collaborator
Collaborator

I have an excel document with numbers representing "Z" values in one column.  The next column has the names of the parts in an assembly.  I thought I had it working, but it turns out the darn parts aren't updating to the differing values, they are ALL going to one value...WTH??

 

Another thing I don't know how to do is format this whole thing for how many instances are in each file.  Could someone help me out with this?

 

Here's the code I'm using:

Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:1", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B1")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:2", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B2")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:3", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B3")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:4", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B4")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:5", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B5")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:6", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B6")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:7", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B7")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:8", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B8")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:9", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B9")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:10", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B10")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:11", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B11")
Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:12", "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B12")

So basically I need for that to run for as many times as there are legs, with the "Support:1" etc. simply incrementing by one each time, and the same thing for the "B-" number at the very end.  Thanks so very much in advance, this will be a HUGE timesaver for my company!

0 Likes
Accepted solutions (1)
458 Views
3 Replies
Replies (3)
Message 2 of 4

matthew_neesley
Collaborator
Collaborator

I just came to the ugly realization that this likely the wrong road.  These are all Factory Utilities Assets...which means that complex API rabbit-hole gain.

https://forums.autodesk.com/t5/inventor-customization/wild-ilogic-asset-idea-insert-connect-asset-at...

0 Likes
Message 3 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@matthew_neesley ,

 

Hoping that below iLogic code may be helpful.

myparam = InputBox("Enter total support legs", "Leg support number", "10")
For a = 1 To Convert.ToInt16(myparam)
	 'Messagebox.Show(a.ToString)
	 Parameter("Copy of 2018_TOS_Insert-Standard Duty Support:" + a.ToString, "TOS") = GoExcel.CellValue("Resize all Legs.xlsx", "Sheet1", "B" + a.ToString)
Next

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 4 of 4

matthew_neesley
Collaborator
Collaborator

Thanks very much for your contribution.  I ended up doing it with revised code from one of your colleagues.

0 Likes