FdScript
Since FEM-Design 17.01.001, we support a basic automation workflow through scripting. It is capable to load/save file, execute analysis calculation and crate outputs as .csv list or .docx documentation. Using scripting you can batch-analyze models created in other programs or directly in .struxml and execute long calculations during the night. The script commands approximate the usual interface, as if you filled inputs on the dialog and press the OK button.
FEM-Design API examples on GitHub
Watch the webinar, where the Run Script feature is described in details.
Contents
Concept
The installation of FEM-Design 17.01.001 (or later version) creates the fdscript.xsd and an example.fdcsript in the templates folder. The latter can be used as a starting point of custom scripts, since it has all the commands intended for users and useful comments on how to proceed.
Launching
To launch the script use the menu command Tools -> Run script, or start the program with the /s command line: fd3dstruct /s c:\mydir\example.fdcsript (e.g. C:\Program Files\StruSoft\FEM-Design 18\fd3dstruct.exe /s C:\Users\xxx\Desktop\Example\ExampleScript.fdscript).
Editing
Example script can be edited by simple notepad/WordPad, but it is more convenient to use Notepad++ or Atom.
Procedure
Log file
Enter the location for the log file that will contain all the information about performed calculations, errors and warnings. Always use absolute path for files!
Model location
Enter the location of the model that will be executed by the Run script function. The model can be saved both as .struxml or .str file type.
Analysis
Select the type of analysis calculations that you wish to perform running the script. This is done by typing "1" or "0" next to the corresponding calculation type in the script example, where "1" means to perform that calculations. The listed calculation types exactly correspond to the order of calculations in the Calculation dialog in FEM-Design.
The example script contains more options to set up calculation parameters, for example details of construction stages analysis, Eigenfrequencies or calculation options for load combinations calculations.
Design
Select whether you want to perform Auto design or Check calculations, by typing "false" or "true" in the corresponding design module part of the script.
Documentation
Generate csv output file
It is possible to generate a csv file from List tables batch. First, select all the tables to list in List tables dialog in FEM-Design and save is as a batch file (.bsc). Then replace the name and location of the batch file (.bsc) and output file (.csv) in the script example.
Export documentation to .docx file
It is possible to export documentation .docx file. Simply replace the name and location of the .docx file in the sample script.
Save the model
The model with documentation and results file will be saved to selected location.
Disclaimer: All example files, wrappers and documentation are for illustrative and educational purposes and may not interact with FEM-Design in a reliable way depending on your version, installation and content of the files. Furthermore, StruSoft won´t guarantee full support of the API functions since they are customizable by the customer.