Using a spreadsheet to store and reuse design data has been a common practice in
engineering for decades. iLogic takes the existing capability to link to an Excel
spreadsheet and increases it by allowing a user to not only read from the
spreadsheet, but to also write to a cell or cells in that spreadsheet. You can also
utilize data on any sheet within that spreadsheet.
This lets you use Excel to define much of your design intent, and simply connect
your spreadsheet directly to your Inventor & iLogic designs.
Other Excel-related iLogic functionality is:
- Find data in a defined column and then read all the data in the row found.
- Open, write and save data to a spreadsheet or spreadsheets.
- Change the source Excel spreadsheet to read and write values.
- Access Excel COM directly to process functions.
We need to create a rule that will allow us to link the values in the rows
and columns in the Excel spreadsheet to the cooresponding parameters in the
model. Once that is completed we can then control different configurations of
the shaft simply by defining a new ID for the shaft. This is controlled with the
ShaftID parameter.
In the rule, create the following code:
i = GoExcel.FindRow("DriveShaft.xls", "Sheet1", "ShaftID", "=", ShaftID)
DriveSectionLength = GoExcel.CurrentRowValue("DriveSectionLength")
BearingSectionLength = GoExcel.CurrentRowValue("BearingSectionLength")
CenterSectionLength= GoExcel.CurrentRowValue("CenterSectionLength")
HubSectionLength= GoExcel.CurrentRowValue("HubSectionLength")
BearingSecDia= GoExcel.CurrentRowValue("BearingSecDia")
HubSecDia= GoExcel.CurrentRowValue("HubSecDia")
CenterSecDia= GoExcel.CurrentRowValue("CenterSecDia")
Once completed we need to update the model when a change is made so add this code:
iLogicVb.UpdateWhenDone = True
This workflow was taken from the "The iLogical Course: They'll be Calling you Radical" 2009 Autodesk University class.
Comments