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. 在这个例子中, we will be using Python.
如果我们有重复性任务,SkyCiv API 将是首选方法. 从长远来看,花更多时间从几个参数生成模型可以节省时间. 保存脚本以便一次又一次地为您的结构使用将可以节省大量时间!
Configure the SkyCiv API
我们需要按照以下步骤开始配置环境以使用 SkyCiv API:
- 使用Python安装SkyCiv包 pip 安装 skyciv
- 创建一个名为的新文件 主要.py
- 进口 天空文明, 我们目前支持多种文件格式 和 数学 主文件中的包
有了这些包, 我们可以使用数学运算, 使用 JSON 美化器打印输出, 并使用 SkyCiv 请求与服务器通信脚本.
输入参数
我们可以在脚本中定义输入参数. 我们只会修改这些值, 该脚本必须创建所有节点, 成员, 支持, 以及我们结构中所需的元素. 在这个例子中, 我们需要声明 高度, 宽度, 和空间 在我们结构的上弦.
节点创建
我们可以去 文件资料 > s3d_model 对象 > 节点. 我们需要使用 x 来定义每个节点的坐标, 和, 和 z 位置. 在我们的脚本中定义了所有节点之后, 我们可以运行脚本并查看这些结果.
Supports and Sections
我们可以去 文件资料 > s3d_model 对象 > 支持. We need to define the ID of the node at which the support is located and the restraint code. 在这种情况下, we will use a fixed support FFFFFF in node 1, and a roller support 射频FRRR 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 这里. 在这个例子中, we will load a section from the database, specifically the 美国人 > 学会 > W shapes > W4x13.
Members creation
We can add members to our structure. 我们可以去 文件资料 > s3d_model 对象 > 成员. 对于我们的例子, it’s important to define the fixities of our members, 在这种情况下, 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, 最佳, and bottom members for both the left and right sides of our truss.
Point Loads creation
我们可以去 文件资料 > s3d_model 对象 > 点荷载. 在我们的例子中, 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.