Applies To | |||
Product(s): | STAAD.Pro | ||
Version(s): | All | ||
Environment: | N/A | ||
Area: | OpenSTAAD | ||
Subarea: | Loading | ||
Original Author: | Bentley Technical Support Group | ||
Problem Description:
How to create Primary Load Case using OpenSTAAD function (VBA and python)
Solution:
You may use these three functions for the task.
Function 1: CreateNewPrimaryLoad
This function creates primary load case with Load Case Title as the only input. If primary load case is created using this function, Load Type will be “None”.
Parameters:
[Input] LCTitle: The load case string title.
[Return Value] Load Case Number
VBA Syntax:
Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
Dim LCTitle As String
LCTitle = "LOAD CASE 1" ' Load Case Title
objOpenSTAAD.Load.CreateNewPrimaryLoad LCTitle
Output:
Array can be used for variable LCTitle
Function 2: CreateNewPrimaryLoadEx
This function creates primary load case with Load Type and Load Case Title as the input
Parameters:
[Input] LCTitle: The load case string title
[Input] LoadType: Type of the load
[Return Value] Load Case Number
VBA Syntax:
Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
Dim LCTitle As String
Dim LoadType As Long
LCTitle = "LOAD CASE 1" ' Load Case Title
LoadType = 0 ' Dead Load Type
objOpenSTAAD.Load.CreateNewPrimaryLoadEx LCTitle, LoadType
Output:
Array can be used for variable LCTitle and LoadType
Function 3: CreateNewPrimaryLoadEx2
This function creates primary load case with Load Type, Load Case Title and Load Case Number as the input
Parameters:
[Input] LCTitle: The load case string title
[Input] LoadType: Type of the load
[Input] LCNo: The load case number.
VBA Syntax:
Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
Dim LCTitle As String
Dim LoadType As Long
Dim LCNo As Long
LCTitle = "LOAD CASE 2" ' Load Case Title
LoadType = 1 ' Live Load Type
LCNo = 2 ' Load Case Number
objOpenSTAAD.Load.CreateNewPrimaryLoadEx2 LCTitle, LoadType, LCNo
Output:
python script:
communities.bentley.com/.../create_5F00_primary_5F00_LC.py
python output:
Array can be used for variable LCTitle, LoadType and LCNo