Show last authors
1 (% class="box floatinginfobox" %)
2 (((
3 [[FEM-Design API examples on GitHub>>https://github.com/strusoft/femdesign-api-example]]
4
5
6 Contents
7
8 {{toc depth="4" start="2"/}}
9 )))
10
11 More in this chapter:
12
13 * [[Getting started>>doc:FEM-Design API.Getting started.WebHome]]
14 * [[Modifying an XML file using Python>>doc:FEM-Design API.Optimization using Python script.WebHome]]
15 * [[API wrapper>>doc:FEM-Design API.API wrapper.WebHome]]
16 * [[Dynamo API >>doc:FEM-Design API.Dynamo API.WebHome]]
17
18 ----
19
20 (% style="text-align: justify;" %)
21 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.
22
23
24 == Webinar ==
25
26 Watch the webinar, where the Run Script feature is described in details.
27
28 * [[Webinar recording>>url:http://li6r.mj.is/lnk/AL4AADQyNgkAAbmpwLAAAAAACK8AAAAAAAEAAAAAAAh0tQBcnLgmvLxdU7XxQOaXlczQx14T2AACPw0/2/dMN158Kq0awaQo6drxKuog/aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g_dj1LMXJRcWhKR2FuNCZpbmRleD0xJmxpc3Q9UExYLU5PZDZ6dEFDeXFWbi1vN3AtYXozNDRuNEowMzdGZg||data-saferedirecturl="https://www.google.com/url?q=http://li6r.mj.is/lnk/AL4AADQyNgkAAbmpwLAAAAAACK8AAAAAAAEAAAAAAAh0tQBcnLgmvLxdU7XxQOaXlczQx14T2AACPw0/2/dMN158Kq0awaQo6drxKuog/aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g_dj1LMXJRcWhKR2FuNCZpbmRleD0xJmxpc3Q9UExYLU5PZDZ6dEFDeXFWbi1vN3AtYXozNDRuNEowMzdGZg&source=gmail&ust=1553861036430000&usg=AFQjCNFCCE3Ve7dIqKqiYh3SqrlIBcP-fQ" rel="noopener noreferrer" target="_blank"]]
29 * [[Webinar Q&A transcript >>url:http://li6r.mj.is/lnk/AL4AADQyNgkAAbmpwLAAAAAACK8AAAAAAAEAAAAAAAh0tQBcnLgmvLxdU7XxQOaXlczQx14T2AACPw0/3/1-61g1WBlFusev5z0dkrtQ/aHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vc3ByZWFkc2hlZXRzL2QvMUxuRG9oNHVlTGlMWVVhNEVxTE5BRndUTHRkdFpuVFlMMTA2NmhfQ0VyNHMvZWRpdD91c3A9c2hhcmluZw||data-saferedirecturl="https://www.google.com/url?q=http://li6r.mj.is/lnk/AL4AADQyNgkAAbmpwLAAAAAACK8AAAAAAAEAAAAAAAh0tQBcnLgmvLxdU7XxQOaXlczQx14T2AACPw0/3/1-61g1WBlFusev5z0dkrtQ/aHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vc3ByZWFkc2hlZXRzL2QvMUxuRG9oNHVlTGlMWVVhNEVxTE5BRndUTHRkdFpuVFlMMTA2NmhfQ0VyNHMvZWRpdD91c3A9c2hhcmluZw&source=gmail&ust=1553861036431000&usg=AFQjCNFFoBG-oDP9SfyygwQRySGua_IYWg" rel="noopener noreferrer" target="_blank"]]
30 * [[Example files used during the webinar>>url:http://li6r.mj.is/lnk/AL4AADQyNgkAAbmpwLAAAAAACK8AAAAAAAEAAAAAAAh0tQBcnLgmvLxdU7XxQOaXlczQx14T2AACPw0/4/MGw6NIUphr-MZWAol6UKHQ/aHR0cHM6Ly9kcml2ZS5nb29nbGUuY29tL2ZpbGUvZC8xQ2REeG03a05SYjR5TEVyQlFvZ2VOVnRnNGJraXJCX0wvdmlldz91c3A9c2hhcmluZw||data-saferedirecturl="https://www.google.com/url?q=http://li6r.mj.is/lnk/AL4AADQyNgkAAbmpwLAAAAAACK8AAAAAAAEAAAAAAAh0tQBcnLgmvLxdU7XxQOaXlczQx14T2AACPw0/4/MGw6NIUphr-MZWAol6UKHQ/aHR0cHM6Ly9kcml2ZS5nb29nbGUuY29tL2ZpbGUvZC8xQ2REeG03a05SYjR5TEVyQlFvZ2VOVnRnNGJraXJCX0wvdmlldz91c3A9c2hhcmluZw&source=gmail&ust=1553861036431000&usg=AFQjCNGP0IKju8YAwvmd1Gu287zxx-ovVg" rel="noopener noreferrer" target="_blank"]]
31
32 == Introduction ==
33
34
35 The installation of FEM-Design 17.01.001 (or later version) creates the (% class="mark" %)fdscript.xsd(%%) and an (% class="mark" %)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.
36
37 == Launching ==
38
39 (% style="text-align: justify;" %)
40 To launch the script use the menu command Tools -> Run script, or start the program with the /s command line: (% class="mark monospace" %)fd3dstruct /s c:\mydir\example.fdcsript(% class="monospace" %) (%%)(e.g. C:\Program Files\StruSoft\FEM-Design 18\fd3dstruct.exe /s C:\Users\xxx\Desktop\Example\ExampleScript.fdscript).
41
42 (% id="HEditing" %)
43 == Editing ==
44
45 (% style="text-align: justify;" %)
46 Example script can be edited by simple notepad/WordPad, but it is more convenient to use Notepad++ or Atom.
47
48
49 == Procedure ==
50
51
52 == Log file ==
53
54 (% style="text-align: justify;" %)
55 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!
56
57 [[image:1549612362680-641.png||height="351" width="983"]]
58
59 == Model location ==
60
61 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.
62
63 [[image:1549612652823-785.png||height="349" width="983"]]
64
65 == Analysis ==
66
67 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.
68
69 [[image:1549966402317-236.png||height="411" width="1088"]]
70
71 (% style="text-align: justify;" %)
72 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.
73
74 (% style="text-align: justify;" %)
75 [[image:1549966676268-347.png||height="421" width="901"]]
76
77 == Design ==
78
79 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.
80
81 [[image:1549967242200-946.png||height="449" width="933"]]
82
83 == Documentation ==
84
85 === Generate csv output file ===
86
87 (((
88 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.
89
90 [[image:1549977359825-234.png||height="352" width="1112"]]
91 )))
92
93 === Export documentation to .docx file ===
94
95 It is possible to export documentation .docx file. Simply replace the name and location of the .docx file in the sample script.
96
97 [[image:1549977343096-649.png||height="342" width="1121"]]
98
99 == Save the model ==
100
101 The model with documentation and results file will be saved to selected location.
102
103 [[image:1549977612444-657.png||height="361" width="956"]]
104
105 ----
106
107 (% style="text-align: justify;" %)
108 (% class="small" %)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.
Copyright 2019 StruSoft AB
FEM-Design Wiki