S3D.structure
The S3D.structure
namespace is where the model is described. From here, you can make changes to the model.
info
S3D.UI.update
may need to be called to reflect changes for any of the following functions.
S3D.structure.get
#
Description: Get the current model object.
Operation Type: Synchronous
Params: options?
Sample:
SkyCiv recommend using the api_format:true
option to work with the API model format. Without this option you will recieve the model in legacy format.
Now there is a reference to the model, you can make changes to any properties. To see the available properties, open a model in S3D and type the above command into the console. Then enter model.
and you will see the available properties in the suggestions.
note
members
are referred to as elements
in this object.
S3D.structure.set
#
Description: Set the active model.
Operation Type: Asynchronous
Params: S3D.structure.set(modelData, fileName?, isUndo?, callback?)
Key | Type | Description |
---|---|---|
modelData | Object | This can be obtained via S3D.structure.get() . |
fileName | string | The new file name of the model. |
isUndo | boolean | Whether the operation should be undoable. |
callback | function | This function will be executed once the model has been set. |
Sample:
The model data should be the same format as the object received when using S3D.structure.get()
. The simplest way to do this is to clone this object, make changes to the clone, then pass the new model into the set
method.
S3D.structure.clear
#
Description: Clears the current model object.
Operation Type: Synchronous
Params: null
Sample:
S3D.structure.nodes
#
The S3D.structure.nodes
namespace provides ways to interact with model nodes.
S3D.stucture.nodes.add
#
Description: Add a node to the model.
Operation Type: Synchronous
Params: S3D.structure.nodes.add(Object)
Object properties:
Key | Type | Description |
---|---|---|
ID | integer | Optional: The ID of the new node. Defaults to next available ID if omitted. |
x | float | The x coordinate of the node. |
y | float | The y coordinate of the node. |
z | float | The z coordinate of the node. |
Sample:
S3D.stucture.nodes.remove
#
Description: Remove nodes from the model.
Operation Type: Synchronous
Params: S3D.structure.nodes.remove(Array)
Array values:
A list of node IDs to be removed.
Sample:
S3D.stucture.nodes.getVector
#
Description: Gets the unit vector between two nodes.
Operation Type: Synchronous
Params: S3D.structure.nodes.getVector(startNode, endNode)
Key | Type | Description |
---|---|---|
startNode | integer | The node ID of the start node. |
endNode | integer | The node ID of the end node. |
Sample:
S3D.structure.members
#
The S3D.structure.members
namespace provides ways to interact with model members.
S3D.stucture.members.add
#
Description: Add a member to the model.
Operation Type: Synchronous
Params: S3D.structure.members.add(Object)
Object properties:
Key | Type | Description |
---|---|---|
ID | integer | Optional: The ID of the new member. Defaults to next available ID if omitted. |
nodeA | integer | Node A of the member. |
nodeB | integer | Node B of the member. |
section_id | integer | Optional: The section ID to apply to the member. |
rotation | float | Optional: The rotation of the member in degrees. |
type | string | Optional: The type of member. Accepts: normal , normal_continuous , rigid , tension , compression , cable , joist |
fixityA | string | Optional: The fixity code for end A. |
fixityB | string | Optional: The fixity code for end B. |
offsetsA | string | Optional: The offset applied to the member (x,y,z). |
offsetsB | string | Optional: The offset applied to the member (x,y,z). |
Sample:
S3D.stucture.members.remove
#
Description: Remove members from the model.
Operation Type: Synchronous
Params: S3D.structure.members.remove(Array)
Array values:
A list of member IDs to be removed.
Sample:
S3D.stucture.members.getLength
#
Description: Gets the length of a member.
Operation Type: Synchronous
Params: S3D.structure.members.getLength(memberId)
Key | Type | Description |
---|---|---|
memberId | integer | The ID of the member whose length to calculate. |
Sample:
S3D.stucture.members.intersect
#
Description: Split a member in various ways.
Operation Type: Synchronous
Params: S3D.stucture.members.intersect(Object)
Object Properties:
Key | Type | Accepts | Description |
---|---|---|---|
typ | string | intersectingNodes , splitStr , intersectingMembers , equalParts | How to split the member. |
memberNo | integer | A normal number. | Member ID to split. |
splitStr | string | A percentage or distance expressed as a string. | "50%" for midway along the member or a float for a distance from nodeA. |
split_nodes_only | boolean | true , false | Only split on nodes. |
inc | integer | A normal number. | Number of increments to split the member into. |
Sample:
S3D.stucture.members.getIntersectingNodes
#
Description: Get all the nodes connected to, or intersecting each member.
Operation Type: Synchronous
Params: S3D.stucture.members.getIntersectingNodes(Object)
Object Properties:
Key | Type | Accepts | Description |
---|---|---|---|
member_id | integer | (Optional) | Include a specific member ID |
Sample:
S3D.structure.plates
#
The S3D.structure.plates
namespace provides methods to interact with model plates.
S3D.stucture.plate.add
#
Description: Add a plate to the model.
Operation Type: Synchronous
Params: S3D.stucture.plate.add(Object)
Object properties:
Key | Type | Description |
---|---|---|
ID | integer | Optional: The ID of the new plate. Defaults to next available ID if omitted. |
nodes | array , string | The nodes that make up the plate. |
thickness | float | The plate thickness. |
material_id | integer | The material id to use with the plate. |
offset | float | Optional: The offset of the plate. |
rotZ | float | Optional: The rotation of the plate. |
state | string | Optional: stess or strain . |
isMeshed | boolean | If the plate is meshed. |
Sample:
S3D.structure.supports
#
S3D.structure.supports.add
#
Description: Add a restraint to the model.
Operation Type: Synchronous
Params: S3D.stucture.supports(Object)
Object Properties:
Key | Type | Description |
---|---|---|
node_id | integer | The node ID to add the restraint. |
fixity | string | A restraint code. |
Sample:
S3D.structure.loads
#
The S3D.structure.loads
namespace provides methods to add and remove loads to the structure.
S3D.structure.loads.point_loads
#
Description: Add point loads to a node or member.
Operation Type: Synchronous
Params: S3D.stucture.loads.point_loads(Object)
Object Properties:
Key | Type | Accepts | Description |
---|---|---|---|
type | string | n , m | How to split the member. |
node | integer | A normal number. | Node ID to apply the force. |
member | integer | A normal number. | Member ID to apply the force. |
position | float | A normal number. | Percentage along the member. E.g. 50 for 50%. |
x_mag | float | Any number. | Force magnitude in the X direction. |
y_mag | float | Any number. | Force magnitude in the Y direction. |
z_mag | float | Any number. | Force magnitude in the Z direction. |
load_group | string | Any string. | The name of the load group to assign the load to. |
Sample:
S3D.structure.loads.distributed_loads
#
Description: Add distributed loads to a member.
Operation Type: Synchronous
Params: S3D.stucture.loads.distributed_loads(Object)
Object Properties:
Key | Type | Accepts | Description |
---|---|---|---|
member | integer | A normal number. | Member ID to apply the force. |
x_mag_A | float | Any number. | Start force magnitude in the X direction. |
y_mag_A | float | Any number. | Start force magnitude in the Y direction. |
z_mag_A | float | Any number. | Start force magnitude in the Z direction. |
x_mag_B | float | Any number. | End force magnitude in the X direction. |
y_mag_B | float | Any number. | End force magnitude in the Y direction. |
z_mag_B | float | Any number. | End force magnitude in the Z direction. |
position_A | float | A normal number. | Percentage along the member to start the load. E.g. 10 for 10%. |
position_B | float | A normal number. | Percentage along the member to finish the load. E.g. 90 for 90%. |
load_group | string | Any string. | The name of the load group to assign the load to. |
axes | global | global , local | Whether the load properties are relative to the global or local axis. |
Sample:
S3D.structure.loads.area_loads
#
Description: Add area loads to the model.
Operation Type: Synchronous
Params: S3D.stucture.loads.area_loads(Object)
Object Properties:
Key | Type | Accepts | Description |
---|---|---|---|
type | string | one_way , two_way , column_wind_load , open_structure | How the area load should be applied. |
nodes | string | - | Comma seperated node IDs to define the area load. |
members | integer | - | |
mag | float | - | The magnitude of the load, in the units of pressure. |
direction | string | X , Y , Z | The direction of the load in the global axes. |
elevations | float | - | Relevant only if "type": "column_wind_load" .The elevations between which the corresponding pressure magnitudes (see next row in this table) should be applied. This property should have 1 more value than the corresponding pressure magnitudes property. |
mags | string | - | Relevant only if "type": "column_wind_load" .The magnitudes of pressures which should be applied between the corresponding elevations (see above row in this table). This property should have 1 less value than the corresponding elevations property. |
column_direction | string | - | Relevant only if "type": "one_way" or "type": "column_wind_load" .The span direction of the applied area load. The values must be the IDs of 2 nodes which are in the nodes property. |
loaded_members_axis | string | all , major | Relevant only if "type": "open_structure" .Whether to apply the open structure load to all members attaching to the nodes (indicated by all ), or to only those members which lie along the global XYZ axes (indicated by major). |
LG | string | - | The load group to which this area load belongs. |
Sample:
S3D.structure.loads.sw
#
S3D.structure.loads.sw.set
#
Description: Add self-weight cases to the model.
Operation Type: Synchronous
Access: set
Params: S3D.structure.loads.sw.set(Object)
Object Properties:
Key | Type | Description |
---|---|---|
Loadcase ID | Object | The property represents the loadcase index and should be greater than 0. The value is an object of key-values x ,y ,z . Each direction should have a value of type float which represents a gravity multiplier. |
Sample:
This sample adds a gravity case of -1×g
in the negative Z direction.
S3D.structure.loads.lc
#
S3D.structure.loads.lc.add
#
Description: Create load combinations.
Operation Type: Synchronous
Access: set
Params: S3D.structure.loads.sw.set(Object)
Object Properties:
Key | Type | Description |
---|---|---|
name | string | The name of the load combination. |
Load Group Name | Factor | Provide the load group name as the property. The value should be the multiplier for the load group as a float. |
Sample:
This sample adds a gravity case of -1×g
in the negative Z direction.
S3D.stucture.COG
#
Description: Get the center of gravity for a group of structural elements.
Operation Type: Synchronous
Access: get
Params: S3D.structure.COG(nodes, elements, plates, sections, materials)
Key | Type | Description |
---|---|---|
nodes | Object | The nodes object from the structural model. |
elements | Object | The elements object from the structural model. |
plates | Object | The plates object from the structural model. |
sections | Object | The sections object from the structural model. |
materials | Object | The materials object from the structural model. |
Sample:
info
To exclude certain elements, for example plates
, pass an empty object {}
.
S3D.structure.COG(nodes, elements, {}, sections, materials);
S3D.structure.repair
#
The S3D.structure.repair
function provides access to the S3D repair tool.
Description: Repair the model.
Operation Type: Synchronous
Params: S3D.structure.repair(Object)
Object properties:
Key | Type | Allowable | Description |
---|---|---|---|
tasks | [string] | unused_nodes , large_structure , merge_nodes , zero_members , continuous_to_normal_members , intersect_members , default_section , force_plate_mesh | An array of strings indicating which tasks to complete. |
force_repair | boolean | true , false | If true, repair will run without prompting the user. |
Sample:
S3D.structure.share
#
The S3D.structure.share
function allows sharing of your model.
Description: Share the current model.
Operation Type: Synchronous
Params: S3D.structure.repair(callback)
Sample: