I'm using STAAD.Pro Script Editor and OpenSTAAD library to generate a structural model.
Unfortunately,the OpenSTAAD function (OSLoadUI::CreateLoadEnvelop) that should allow creating load envelopes is not working properly.
Question: Is Bentley Software / Technical Group is aware or been notified about this bug / error? Any help will be much appreciated.
This is the information provided by the OpenSTAAD Library. Also note that by browsing the object library the OpenSTAAD command is written as "CraeteLoadEnvelop", not "CreateLoadEnvelop". There is a typo as well.
Creates a Load Envelop with specified primary load case(s) and envelop type.
Surojit Ghosh
amabrich
'WinWrap language (VBA) Dim objSTAADGUI As Object 'Launch OpenSTAAD GUI Object Set objSTAADGUI = GetObject(,"StaadPro.OpenSTAAD") 'Array for Load Cases Dim varLoadCaseList1(5) As Variant varLoadCaseList1(0) = 25 varLoadCaseList1(1) = 26 varLoadCaseList1(2) = 27 varLoadCaseList1(3) = 28 varLoadCaseList1(4) = 29 varLoadCaseList1(5) = 30 'Add a list of primary load case(s) into #1 load envelop (type of STRESS). objSTAADGUI.CraeteLoadEnvelop(1, 1, varLoadCaseList1())
Did you try to define Openstaad function in the first line and use the same parameter to be the operation, for example
Dim objOpenSTAAD As Object'Get the application objectSet objOpenSTAAD = GetObject( , "StaadPro.OpenSTAAD")
'WinWrap language (VBA)
'Array for Load Cases Dim varLoadCaseList1(5) As Variant
varLoadCaseList1(0) = 25 varLoadCaseList1(1) = 26 varLoadCaseList1(2) = 27 varLoadCaseList1(3) = 28 varLoadCaseList1(4) = 29 varLoadCaseList1(5) = 30
'Add a list of primary load case(s) into #1 load envelop (type of STRESS).objOpenSTAAD.Load.CraeteLoadEnvelop(1, 1, varLoadCaseList1())
After testing the code, OpenSTAAD function only creates the envelopes by typing the function as objOpenSTAAD.Load.CreateLoadEnvelop(varEnvNo, varEnvType, varLoadCaseList).
However, OpenSTAAD.Load.CreateLoadEnvelop is not assigning properly varLoadCaseList parameter. The only solution for this to work is by using the OpenSTAAD funtion Load.AddLoadCasesToEnvelop. See code solution below.
'Array for Load CasesDim varLoadCaseList1(5) As Variant
varLoadCaseList1(0) = 25varLoadCaseList1(1) = 26varLoadCaseList1(2) = 27varLoadCaseList1(3) = 28varLoadCaseList1(4) = 29varLoadCaseList1(5) = 30
'Add a list of primary load case(s) into #1 load envelop (type of STRESS).objOpenSTAAD.Load.CreateLoadEnvelop(1, 1, varLoadCaseList1(0))
For i = 0 To 5 objSTAADGUI.Load.AddLoadCasesToEnvelop(1, varLoadCaseList1(i)) Next
Answer Verified By: Denisson Cruz