Applies To | |||
Product(s): | STAAD.Pro | ||
Version(s): | All | ||
Environment: | N/A | ||
Area: | OpenSTAAD | ||
Subarea: | Geometry | ||
Original Author: | Bentley Technical Support Group, Shreyanka Bhattacharjee | ||
Problem Description:
How to create triangular/quadrilateral plate using OpenSTAAD (VBA and python)
Solution:
You may use function AddPlate or CreatePlate
AddPlate adds a plate with specified existing nodes in current model, and returns the plate number ID automatically assigned with.
CreatePlate creates a plate with specified existing nodes in current model and with specified plate number
Parameter:
AddPlate
[Input] nNodeA: Number ID of end node (nodeA) for plate connectivity.
[Input] nNodeB : Number ID of end node (nodeB) for plate connectivity.
[Input] nNodeC : Number ID of end node (nodeC) for plate connectivity.
[Input] nNodeD: (Optional) Number ID of end node (nodeD) for plate connectivity. To add triangular plate, the value of this parameter will be 0
[Return Value] node: Plate number ID to be assigned to the newly created plate
CreatePlate
[Input] nPlateNo: Plate number ID
[Input] nNodeA: Number ID of end node (nodeA) for plate connectivity.
[Input] nNodeB : Number ID of end node (nodeB) for plate connectivity.
[Input] nNodeC : Number ID of end node (nodeC) for plate connectivity.
[Input] nNodeD: (Optional) Number ID of end node (nodeD) for plate connectivity. To create triangular plate, the value of this parameter will be 0
Sample VBA syntax AddPlate (To create triangular plate):
Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
Dim nNodeA(1) As Long
Dim nNodeB(1) As Long
Dim nNodeC(1) As Long
Dim nNodeD(1) As Long
Dim plate(1) As Long
nNodeA(0) = 1
nNodeB(0) = 2
nNodeC(0) = 3
nNodeD(0) = 0
nNodeA(1) = 2
nNodeB(1) = 5
nNodeC(1) = 6
nNodeD(1) = 0
For i = 0 To 1
plate(i) = objOpenSTAAD.Geometry.AddPlate(nNodeA(i), nNodeB(i), nNodeC(i), nNodeD(i))
Next i
Output:
Sample VBA syntax CreatePlate (To create quadrilateral plate):
Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
Dim nNodeA(1) As Long
Dim nNodeB(1) As Long
Dim nNodeC(1) As Long
Dim nNodeD(1) As Long
Dim nPlateNo(1) As Long
nNodeA(0) = 1
nNodeB(0) = 2
nNodeC(0) = 3
nNodeD(0) = 4
nPlateNo(0) = 1
nNodeA(1) = 2
nNodeB(1) = 5
nNodeC(1) = 6
nNodeD(1) = 3
nPlateNo(1) = 2
For i = 0 To 1
objOpenSTAAD.Geometry.CreatePlate nPlateNo(i), nNodeA(i), nNodeB(i), nNodeC(i), nNodeD(i)
Next i
Output:
Sample python script:
communities.bentley.com/.../addplate.py