Professional Documents
Culture Documents
Practice Workbook
This workbook is designed for use for Live instructor led training and for OnDemand training. The explanation,
demonstration, and narrative content are provided by the instructor in the classroom and in the OnDemand
eLearning version of this course available through Bentley LEARN (learn.bentley.com).
This exercise workbook is formatted for onscreen viewing using a PDF reader.
TRN020150-1/0001-PW03
maximum bending moments (about the local Z axis) for Beam #21 using the STAAD.Pro model and analysis.
Beam #21
3. Highlight the RCBeamDesign macro in the Macro dialog. Then, click on the Edit button.
4. Notice that this macro has been called RCBeamDesign using the following code:
Sub RCBeamDesign()
Note: Double click on the Sheet2 (STAAD.Pro Output) item in the VBAProject. Notice that the code to execute the RCBeamDesign macro when
the Get Results button is clicked has already been created. Double click on th Module 1 item in the VBAProject to return to the
RCBeamDesign macro.
5. Enter the following functions in the Macro Design Window to initial the OpenSTAAD object:
Dim objSTAADGUI As Object
Set objSTAADGUI = GetObject (,STAADPro.OpenSTAAD)
6. Enter the following functions to obtain link to the current STAAD.Pro model:
Dim stdFile As String
objSTAADGUI.GetSTAADFile stdFile, True
If stdFile = Then
MsgBox This macro can only be run with a valid STAADfile loaded.,
vbOKOnly
Set objSTAADGUI = Nothing
Exit Sub
End If
Cells(2,2).Value = stdFile
3. Check the STAADLibBentley option in the References - VBAProject dialog. Then, click OK.
4. Click on the Object Browser icon in the Standard toolbar.
5. Select STAADLibBentley in the pull down menu. Notice that details of each of the OpenSTAAD functions is available now through the
Object Browser in Excel.
3. Enter the following functions to verify if the member exists in the STAAD.Pro model:
Dim Length As Double
Length = objSTAADGUI.Geometry.GetBeamLength (MemberNo)
If Length = 0 Then
MsgBox Please check the member number is valid., vbOKOnly
Set objSTAADGUI = Nothing
Exit Sub
End If
4. Enter the following functions to retrieve the member properties from the STAAD.Pro model:
Dim YD As Double
Dim ZD As Double
objSTAADGUI.Property.GetBeamProperty MemberNo, ZD, YD
Cells(7, 7).Value = YD
Cells(8, 7).Value = ZD
2. Enter the following functions to retrieve the number of load combinations defined in the STAAD.Pro model:
Dim LCaseCount As Integer
LCaseCount = objSTAADGUI.Load.GetPrimaryLoadCaseCount
Cells(4, 2).Value = LCaseCount
Dim LComboCount As Integer
LComboCount = objSTAADGUI.Load.GetLoadCombinationCaseCount
Cells(5, 2).Value = LComboCount
3. Enter the following functions to limit the number of load combinations to 10:
If LComboCount > 10 Then
MsgBox (This macro is designed for up to 10 load combinations only.)
Set objSTAADGUI = Nothing
Exit Sub
End If
Note: The Excel spreadsheet was created to consider a maximum of 10 load combinations.
4. Enter the following functions to obtain the load combination titles from the STAAD.Pro model:
Dim LComboNum() As Long
ReDim LComboNum(LComboCount)
Dim LComboTitle() As String
ReDim LComboTitle(LComboCount)
Dim i As Integer
For i = 1 To LComboCount
LComboNum(i) = i + LCaseCount
LComboTitle(i) = objSTAADGUI.Load.GetLoadCaseTitle(i + LCaseCount)
Cells(10, i + 1).Value = LComboNum(i)
Cells(11, i + 1).Value = LComboTitle(i)
Copyright 2012 Bentley Systems, Incorporated
5. Enter the following functions to retrieve the maximum member moment results:
Dim DMax As Double
Dim dMaxPos As Double
Dim DMin As Double
Dim dMinPos As Double
objSTAADGUI.Output.GetMinMaxBendingMoment MemberNo, MZ, LComboNum(i), DMax, dMaxPos, DMin, dMinPos
Next i
7. Save and close the Macro Design Window for the next exercise.
1. Continue with the Microsoft Excel worksheet from the previous exercise.
2. Select the STAAD.Pro Output worksheet.
3. Enter 21 into field B-7 to instruct the macro to obtain the results to beam #21 in the STAAD.Pro model.
4. Click on the Clear Results button to ensure we start with an empty spreadsheet.
5. Click on the Get Results button to run the macro and obtain the results from the STAAD.Pro model.
6. Enter the appropriate parameters for this beam (indicated in the Yellow Fields) to define the following:
Reinforcement Data
Material Data
Note: The calculations in the Concrete worksheet have already been defined using the parameters entered for the beam.