cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying Parameters with Excel Spreadsheet

Highlighted

Re: Modifying Parameters with Excel Spreadsheet

Came up with a solution for forcing Creo to regenerate the Excel Analysis every time. I made a simple parameter called "TOGGLE" and a relation that sets it to 1 if it's 0 and sets it to 0 if it's not. Then I pass that parameter to the Excel Analysis, pasting it in some empty cell. Excel doesn't need to do anything with it; just the fact that it has changed forces Creo to re-check the Excel sheet.

 

After this, I still had to regenerate twice for my simple part to update. The reason was that I had my output parameters connected to my extrude in the part relations, and these are checked before regeneration, so Creo would set them to the Excel Analysis output parameters and then do the Excel Analysis. to get it to work with a single regeneration, I had to set the relations as feature relations in my Extrude feature, so it's evaluated after the Excel Analysis is done. I normally advise against using feature relations, since it's so hard for others to find, but if you want to make the part update with a single regeneration, that's how you have to do it, I think. You could add some comments to the part level relations to say that there are feature relations in some specific features.

 

Of course, the above solution will cause really long regen times, as Creo has to open the spreadsheet every time you regenerate. For a real fancy solution, you could do something like this:

 

  1. Have a text file containing just the text "VERSION=0"
  2. Make an Excel macro that increases the version number in the text file every time you save.
  3. Make a PRO/PROGRAM that inputs a VERSION parameter.
  4. Send the VERSION parameter to the Excel Analysis as described above.
  5. Make a mapkey that regenerates the part using the text file as input.

Now, when you use the mapkey to regenerate, Creo will read the version number from the text file. If it is the same as last time, the Excel Analysis won't get recalculated, as the input is the same. If the Excel file has been changed, the version number has updated, and the input to the Excel file is different, so Creo will regenerate it. Of course, this requires a special mapkey to regenerate, and it's not evident how you'd do this with several different parts. I wish Creo had a way to hard-code into the part which text file to read its inputs from, but as far as I know, that can't be done.

 

 

Yet another way to do this is as described in this thread: https://community.ptc.com/t5/Part-Modeling/How-do-you-drive-a-Creo-Parametric-Part-prt-parameters/td...

 

That method instead uses Excel to save a text file with parameter values and a mapkey that imports the text file contents into the relations, bypassing the need for an Excel Analysis or PRO/PROGRAM completely.

Announcements
Message from Brian Thompson (PTC General Manager and DVP) regarding Creo Business Continuity plans.