GetLoadCombinationCaseCount
VB Syntax
integer GetLoadCombinationCaseCount (integer pnCount) Parameters
pnCount
An integer variable which the function will use to store the number of load combination cases.
Remarks
This function retrieves the number of load combination cases in the currently open STAAD file. It then stores that number in an integer variable passed to it as a parameter.
Example
Sub CountLCombs()
'Declare OpenSTAAD object variable As Output.
Dim objOpenSTAAD As Output
'Declare an integer variable for storing the function results.
Dim pnCount As Integer
'Run an instance of OpenSTAAD and open STAAD Example No. 1 (US).
Set objOpenSTAAD = CreateObject("OpenSTAAD.Output.1")
objOpenSTAAD.SelectSTAADFile "C:\SPRO2001\STAAD\Examp\US\examp01.std"
'Retrieve the number of load combinations and store that number in the ' pnCount variable.
objOpenSTAAD.GetLoadCombinationCaseCount pnCount
'Close the STAAD file and release the handles to the OpenSTAAD library.
objOpenSTAAD.CloseSTAADFile Set objOpenSTAAD = Nothing
See Also
GetPrimaryLoadCaseCount
141
GetPrimaryLoadCaseCount
VB Syntax
integer GetPrimaryLoadCaseCount (integer pnCount) Parameters
pnCount
An integer variable which the function will use to store the number of primary load cases.
Remarks
This function retrieves the number of primary load cases in the currently open STAAD file. It then stores that number in an integer variable passed to it as a parameter.
Example
Sub CountLCs()
Dim objOpenSTAAD As Output Dim pnCount As Integer
'Run an instance of OpenSTAAD and open STAAD Example No. 1 (US).
Set objOpenSTAAD = CreateObject("OpenSTAAD.Output.1")
objOpenSTAAD.SelectSTAADFile "C:\SPRO2001\STAAD\Examp\US\examp01.std"
'Retrieve the number of primary load cases and store that number in the pnCount ' variable.
objOpenSTAAD.GetPrimaryLoadCaseCount pnCount
'Close the STAAD file and release the handles to the OpenSTAAD library.
objOpenSTAAD.CloseSTAADFile Set objOpenSTAAD = Nothing End Sub
See Also
GetLoadCombinationCaseCount
GetFirstLoadCase
VB Syntax
GetFirstLoadCase (integer pnLoad, string pstrLoadName) Parameters
pnLoad
An integer variable for the function to use in storing the load case number it retrieves from STAAD.Pro.
pstrLoadName
A string variable for the function to use in storing the load case name it retrieves from STAAD.Pro.
Remarks
This function retrieves the first load case number and corresponding load case name for the currently open STAAD file. The function stores the first load case number and corresponding load case name in variables passed to it as parameters. The program stores the first load case number in the pnLoad integer variable and the corresponding load case name in the pstrLoadName string variable.
This function should always be used before the GetNextLoadCase function is called to determine the first load case number (load cases are not necessarily numbered consecutively, and the first load case number may not always be number 1).
Example
Sub FirstLC()
'Declare OpenSTAAD object variable As Output.
Dim objOpenSTAAD As Output
'Declare two variables for storing the function results.
Dim pnLoad As Integer Dim pstrLoadName As String
'Run an instance of OpenSTAAD and open STAAD Example No. 1 (US).
Set objOpenSTAAD = CreateObject("OpenSTAAD.Output.1")
objOpenSTAAD.SelectSTAADFile "C:\SPRO2001\STAAD\Examp\US\examp01.std"
'Retrieve the first load case number and name.
143
objOpenSTAAD.GetFirstLoadCase pnLoad, pstrLoadName
'Close the STAAD file and release the handles to the OpenSTAAD library.
objOpenSTAAD.CloseSTAADFile Set objOpenSTAAD = Nothing End Sub
See Also
GetNextLoadCase
GetNextLoadCase
VB Syntax
GetNextLoadCase (integer nPrevLoadCase, integer pnLoad, string strLoadName)
Parameters nPrevLoadCase
An integer value passed to the function to specify the load case number which directly precedes in numerical order the load case number and name we wish to retrieve.
pnLoad
An integer variable name passed to the function for it to use in storing the load case number it retrieves from STAAD.Pro.
strLoadName
A string variable name passed to the function for it to use in storing the load case name it retrieves from STAAD.Pro.
Remarks
This function retrieves the next load case number and load case name when given the previous load case number. Before this function is called, the GetFirstLoadCase function should be used to obtain the load case number for the first load case. This function can then be used to obtain the load case number and name for successive load cases.
Example
Sub getLCs()
'Declare OpenSTAAD object variable As Output.
Dim objOpenSTAAD As Output
'Declare variables for storing the function results.
Dim pnPriCount As Integer Dim pnCombCount As Integer Dim pnCount As Integer Dim pnLoad1 As Integer Dim pnLoad As Integer Dim nPrevLoadCase As Integer
145
Dim pstrLoadName As String
'Run an instance of OpenSTAAD and open STAAD Example No. 1 (US).
Set objOpenSTAAD = CreateObject("OpenSTAAD.Output.1")
objOpenSTAAD.SelectSTAADFile "C:\SPRO2001\STAAD\Examp\US\examp01.std"
'Retrieve the number of primary load cases and store that number in the ' pnPriCount variable.
objOpenSTAAD.GetPrimaryLoadCaseCount pnPriCount
'Retrieve the number of load combinations and store that number in the ' pnCombCount variable.
objOpenSTAAD.GetLoadCombinationCaseCount pnCombCount 'Calculate the total number of load cases.
pnCount = pnPriCount + pnCombCount
'Retrieve the first load case number and name.
objOpenSTAAD.GetFirstLoadCase pnLoad1, pstrLoadName
'Set the previous load case number for the GetNextLoadCase function ' equal to the first case load number.
nPrevLoadCase = pnLoad1
'Iterate through the load cases and plot their load case numbers and names ' in an Excel worksheet.
For i = 1 to pnCount
objOpenSTAAD.GetNextLoadCase nPrevLoadCase, pnLoad, strLoadName Cells(31 + i, 11).Value = pnLoad
Cells(31 + i, 12).Value = strLoadName
'Set the previous load case number equal to the load case the function ' just retrieved, so we can go on to the next load case.
nPrevLoadCase = pnLoad Next i
'Close the STAAD file and release the handles to the OpenSTAAD library.
objOpenSTAAD.CloseSTAADFile Set objOpenSTAAD = Nothing End Sub
See Also
GetFirstLoadCase