Run script

Last modified by Iwona Budny Bjergø on 2019/09/11 11:34

More in this chapter:


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.

Webinar

Watch the webinar, where the Run Script feature is described in details.

Introduction

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!

1549612362680-641.png

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.

1549612652823-785.png

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.

1549966402317-236.png

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.

1549966676268-347.png

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.

1549967242200-946.png

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.

1549977359825-234.png

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.

1549977343096-649.png

Save the model

The model with documentation and results file will be saved to selected location.

1549977612444-657.png


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.

Tags: API
Created by IwonaBudny on 2019/02/07 13:10
   
Copyright 2019 StruSoft AB
FEM-Design Wiki