- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I managed to create the following:
I can fill in parameters in a Excelfile on my local disk, upon saving the Excelfile, my C# script tells Inventor to execute the iLogic code. The iLogic code reads out the Excel parameters, creates the according model, and saves it as STEP. So basically this allows me to create models without having to do anything in Inventor.
What i want to change:
Instead of changing the parameters inside the Excelfile (overwriting the existing file), i want the iLogic code to execute when a new Excel parameter file is added in the local disk folder (so every model comes from a seperate Excel file). Now i can probably put this in my C# script, but I run into a problem.
The problem:
Right now i reference to my Excelfile inside my iLogic code as:
Excelfile = "C:\Users\Administrator\OneDrive\EMS source.xlsx"
This works fine if the Excelfile gets overwritten, since this reference is always the same. But since i want to import the parameters for every model from a new Excel file, i need this reference to be dynamic.
What help do i need:
I think i can solve this by changing my C# script to do the following things
1. The reference to the Excelfile should be changed everytime a Excelfile is added to the folder. So instead of
Excelfile = "C:\Users\Administrator\OneDrive\EMS source.xlsx"
a dynamic reference should be added. I think i can do this by using the Inventor API inside my C# script to change the reference inside the iLogic code, but i'm not sure. Maybe theres an easy way to solve this inside iLogic?
2. Instead of executing the iLogic when the Excelfile is saved, it should execute after:
Excelfile is added to the disk AND the refence is changed correctly (point 1)
I'm not sure what the right path is, any tips or ways to solve the problem described above is greatly appreciated.
Also example code i can use to achieve this goal is appreciated.
Thanks for taking time to read this, if more reference is needed feel free to ask.
Daan
Solved! Go to Solution.