Using the SkyCiv API
The SkyCiv Structural Analysis and Design API allows engineers to access all the features and functionality of SkyCiv software for their own solutions. In this example, we will be using Python.
The SkyCiv API would be the preferred method if we have repetitive tasks. Spending more time in generating models from a few parameters would save hours in the long run. Saving a script to use time and time again for your structures would be a great time saver!
Configure the SkyCiv API
We need to start configuring the environment to use the SkyCiv API following the next steps:
- Install the SkyCiv Package in Python using pip install skyciv
- Create a new file called main.py
- Import skyciv, json and math packages in the main file
With these packages, we can use mathematical operations, print the output using the JSON beautifier, and use the SkyCiv request to communicate the script with the server.
Input Parameters
We can define the input parameters in our script. We will only modify these values, the script must create all the nodes, members, supports, and the required elements in our structure. In this example, we need to declare the height, width, and spaces at the top chord of our Structure.
Nodes creation
We can go to documentation > The s3d_model object > nodes. We need to define the coordinates of every node by using the x, y, and z positions. After we have all of our nodes defined in our script, we can run the script and see these results.
Supports and Sections
We can go to documentation > The s3d_model object > supports. We need to define the ID of the node at which the support is located and the restraint code. In this case, we will use a fixed support FFFFFF in node 1, and a roller support RFFRRR in node 3.
To create sections, we can load sections of the database, load custom data, define the properties of the section, and more options that you can check here. In this example, we will load a section from the database, specifically the American > AISC > W shapes > W4x13.
Members creation
We can add members to our structure. We can go to documentation > The s3d_model object > members. For our example, it’s important to define the fixities of our members, in this case, as we are using truss elements we need to use FFFFRR, because we don’t want to transmit moments to other elements. We will define vertical, diagonal, top, and bottom members for both the left and right sides of our truss.
Point Loads creation
We can go to documentation > The s3d_model object > point loads. In our example, we will apply the point loads to our nodes. All the loads will be in the y direction, and the load group will be equal to DL. The nodes where we need to apply these loads are 1, 2, 3.
FAQ
Every SkyCiv user has a maximum number of API credits available based on their account level. More information here.
SkyCiv Configurator solutions are custom-built software that allows manufacturers and engineers to design more efficiently using design automation. For more information, check this link
We have SkyCiv packages for Python, Javascript, and C#. However, you can manually call the API from any language that supports HTTP requests.