Using Lua Scripts with Design Studio for Automatically Creating PowerPoint Slides and Excel Spreadsheets Containing GENESIS Optimization Results
Product = Design Studio
Lua scripts can be used with Design Studio to automate tedious tasks. One such script gives the user the ability to create slides of parts with their masses and thicknesses rapidly. This can be applied to shell parts being optimized by sizing for thickness. Within a couple of seconds, all the parts with their thicknesses and masses are displayed in individual slides. This script also creates a spreadsheet that lists the parts, thicknesses, and masses for use in creating charts and tables. Generally, the script can be run on the original model before optimization, and then again on the model after optimization to give the before and after slides and excel sheets. This makes it easy to create slides comparing the optimized results with the original model. This blog will walk through using the script with the original and optimized models.
Once the original model is loaded and before you optimize it, you’ll find the Lua scripts by going to the Plugins page and selecting Lua Scripting from the module pull down.
On the Lua scripts page there is a script called “pptx_parts_pictures.lua” at the bottom of the list showing the scripts included in the install. *Please note that your installation might either contain this script or not. If you cannot find the listed script, you can contact us to provide it for you. Altair provides scripts free of cost and in certain cases can help you create your own customized scripts.
When you hit Run on this, it will create three things in your project directory; a directory of pictures of each part, a deck of slides with each part using those pictures with mass and thickness and ordered in the deck by mass, as well as a spread sheet with the same information listed.
Once these are created on the original un-optimized model, add “original” to the name of each of these three in the project directory so they won’t be overwritten by the script when this is also done for the optimized model. When you are ready to optimize a model, go to Genesis Options, File Control tab and find the Updated Input File option at the top of the right column. Activate this and set it to Last Cycle in the pulldown. This will cause Genesis to output a dat file of the optimized model configuration after optimization is finished.
When the optimization is done, look in the work directory for the file ‘project name_dsgUPDATEXX.dat’ where XX is the last design cycle of the optimization. Use File- Import-Input Data to bring it into Design Studio. It can be brought into the same Design Studio window with the original model as a new model or it can be brought into a new Design Studio window. If you bring it into the same window as the original model, use the Models pulldown on the top menu bar to switch models as needed.
With the UPDATE model active in the Design Studio window, go to the Plugins page and hit Run on the pptx_parts_pictures.lua to create the new set of pictures, slides, and excel sheet for the optimized model. It might be helpful to also add to the names of the new set of files/directory to distinguish those as belonging to the optimized model. Once these files are created, they can be used to create tables, graphs, slides, etc.. for presenting data comparing the model before and after optimization. We at Altair hope you have found this tip useful for grabbing large sets of data rapidly for use in presentations. If you currently do not have GENESIS and/or Design Studio, please leave a comment below.