OpenAPI
What is it?
SCIA OpenAPI is a platform that can be easily used by :
- structural engineers for creating their own programs and scripts using the SCIA Engineer functionality with a goal to provide the best possible design. Structural engineers not experienced in programming can get inspiration from provided examples and quickly learn how to produce first scripts or programs to design the best possible structures.
- software developers hired by structural engineering companies with a goal to automate their company processes regarding structural design.
- software companies producing a software that needs some structural calculations (e.g. design of concrete anchors).
OpenAPI is a platform intended as a base for automation within structural design. It expose SCIA Engineer functionality to several development environments.
This platform is deployed in a .dll library that is intended to be referenced from external development environment.
It can be used e.g. for:
- parametric design to create complicated shape of structure based on some mathematical prescription
- parametric design of some repeating structure
- iterative design to e.g. find the shape of structure with zero bending moment
SCIA.OpenAPI.dll is written in C# language and its functionality can be used in various languages:
- C#.NET - https://visualstudio.microsoft.com/vs/
- Python - https://www.python.org/downloads/
- VB.NET - hhttps://visualstudio.microsoft.com/vs/
OpenAPI technology wraps several SCIA Engineer technologies:
- ADM - analytical data model - for work with the model (e.g. create material, cross-section, beam, support)
- RAPI - results API - for work with the results (e.g. to load deformations on slab for particular mesh element)
- EsaAutomation - platform for remote control of SCIA Engineer environment (e.g. start SCIA Engineer in background, open project template, calculate project, import from XML, etc.)
Documentation
- Template for Visual Studio
Here you can find template of the SCIA OpenAPI project for the Visual Studio (versions 2019, 2022). Sample examples of basic commands are included, so you can easily and quickly start to use it. - Examples on GitHub
Here you can find example projects in several programming languages and it is the best way to start using OpenAPI and fastest way to learn it. Every example contains readme file where you can find instructions how to prepare your computer to start writing your code, plus it contains the example code how to set the project, create a node, beam, slab, load case, point force, how to calculate, how to get results.
IMPORTANT: Support of using VB.NET and Python is only for SCIA Engineer 21.1 and older. From version SCIA Engineer 22.0 and on we are focus only on developing and maintaning the workflow in C#. For that we recommend to use the Visual Studio template mentioned in the previous part above. - SCIA OpenAPI technical documentation
Here you can find list of namespaces, classes, methods, parameters and their description. This documentation is generated from OpenAPI source code. - IntelliSense documentation available in MS Visual Studio
Tips and Tricks
General:
- Make sure that processes ESA.exe and SignalR server/client (SciaTools.AdmToAdm.HubServer.exe and SciaTools.AdmToAdm.HubClient.exe) do not run when you're starting your project's executable
- Experienced users can use the ADM (analytical data model) directly. The direct use of ADM brings experienced users more functionalities, that are included in ADM but not in OpenAPI yet. Direct use of ADM offers more possibilities but is more complicated. Documentation for direct usage of ADM can be found here.
- Empty structural nodes (i.e. structural nodes without any reference, e.g. to beam) cannot be created in SCIA Engineerusing the OpenAPI (ADM). It has consequences - for example following use case will fail:
1) via OpenAPI create 4 nodes N1 - N4 , create beam B1 from N1 to N2 (N3 and N4 are not used so far)
2) Send model from ADM to SCIA Engineer
3) via OpenAPI create beam B2 from N3 to N4 in ADM
4) Send model from ADM to SCIA Engineer
5) => it fails because N3 and N4 does not exist because during model sync (step2) they were not used and thus were deleted and are not available for definition in step 3,4 - When finishing your work with OpenAPI in your script/program, don't forget to call the SCIA.OpenAPI.Environment.Dispose() method for your specific Environment object to correctly free the resources!!!
Python:
- In constructor (not non-parametric) the exact data types must be used!!! If not, python.net just use the non-parametric constructor even if you pass 5 parameters and you think you're using the constructor with parameters. This would cause issue later when you want to work with object. For instance, it means that when you're creating the StructNode, as last parameter (double) you can't use the "0" value (int), but "0.0" value (double).