OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

download OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

of 12

Transcript of OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    1/12

    Bentley Institute Training

    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.

    Using Macros in STAAD.Pro -

    Case 2: Obtaining Output

    OpenSTAAD Fundamentals - July 2012

    TRN020150-1/0001-PW02

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    2/12

    Copyright 2012 Bentley Systems, Incorporated 2

    Initiate OpenSTAAD

    Create a New Macro and Initiate OpenSTAAD.

    1. Open OpenSTAADDataset.stdin STAAD.

    2. Click on the Run VB Macroicon in the File toolbar.

    3. Click on the Create Newbutton in the Macrodialog.

    4. Navigate to the dataset that was supplied with this training and then enter the following parameters in the Select New Macro File Namedialog:

    File Name: Training_Nodal Deflections

    Save as Type:Macro Files (*.vbs)

    Description of the Macro: Maximum Nodal Displacements

    Click on theNewbutton.

    5. Enter the following function to initiate OpenSTAAD:

    SubMain()

    DESCRIPTION:Maximum Nodal Displacement

    Set objSTAADGUI = GetObject(,STAADPro.OpenSTAAD)

    End Sub

    6. Right-click in the Macro Design Window and select Edit > Referencesfrom the pop-up menu.

    7. Check the STAADLibBentley (1.0)reference in the Referencesdialog. Then, click OK.

    8. Keep this model open for the next exercise.

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    3/12

    Get the Primary Load Case Information

    Learn to obtain the primary load case information from the STAAD.Pro main application.

    1. Continue with the model from the previous exercise.

    2. Enter the following functions to define the primary load case variables:

    DimiAs Integer

    DimLCaseCountAs Integer

    DimLCaseNum()As Long

    DimLCaseName()As String

    3. Enter the following functions to retrieve the Primary Load Case Information from the active STAAD.Pro model:

    LCaseCount = objSTAADGUI.Load.GetPrimaryLoadCaseCount()

    ReDimLCaseNum(LCaseCount)

    ReDimLCaseName(LCaseCount)

    objSTAADGUI.Load.GetPrimaryLoadCaseNumbersLCaseNum

    For i = 0 ToLCaseCount-1

    LCaseName(i) = CStr(LCaseNum(i)) & : & objSTAADGUI.Load.GetLoadCaseTitle(LCaseNum(i))

    Nexti

    4. Keep this model open for the next exercise.

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    4/12

    Copyright 2012 Bentley Systems, Incorporated 4

    Create the Select Load Case Dialog

    Learn to create a dialog to be used in the STAAD.Pro main application to select the applicable load case.

    1. Continue with the model from the previous exercise.

    Note: In this exercise, we will create the following user dialog to select a defined load case:

    2. Click on the Edit User Dialogicon.

    3. Double-click anywhere within the new dialog in the UserDialog Editor.

    4. Enter the following information into the Edit UserDialog Propertiesdialog:

    Caption: Select Load Case

    Then, click on the double right arrowbutton to enter the name of the dialog box.

    5. Click on the Add Text icon in the UserDialogEditor. Click within the new dialog to define the text box location and then double-click withinthe new text box.

    6. Enter the following information into the Edit Text Propertiesdialog:

    Caption: Load Case:

    Quoted: (checked)

    Click on the double right arrowbutton to enter the name of the field. Then, click Close.

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    5/12Copyright 2012 Bentley Systems, Incorporated 5

    7. Click on the Add List Boxicon in the UserDialog Editor. Click within the new dialog to define the list box location and then double-clickwithin the new list box.

    8. Enter the following information into the Edit List Box Propertiesdialog:

    Array: LCaseName

    Click on the double right arrowbutton to enter the name of the field. Then, click Close.

    9. Click on the Add OK Buttonicon in the New UserDialog Editor. Then, click within the new dialog to define the OK button.

    10. Click on the Add Cancel Buttonicon in the New UserDialog Editor. Then, click within the new dialog to define the Cancel button.

    11. Click on the Save and Editicon in the New UserDialog Editor.

    12. Delete the last line of this code (Dialog dlg).

    13. Keep this model open for the next exercise.

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    6/12Copyright 2012 Bentley Systems, Incorporated 6

    Obtain the Selected Load Case Results

    Learn to define the variables that were used in the Select Load Case dialog.

    1. Continue with the model from the previous exercise.

    2. Enter the following functions to define the input variables:

    DimdlgResultAs Integer

    dlgResult = Dialog(dlg)

    IfdlgResult = -1 Then

    DimLoadCaseAs Long

    DimLoadCaseNameAs String

    LoadCase = LCaseNum(dlg.ListBox1)

    LoadCaseName = LCaseName(dlg.ListBox1)

    3. Enter the following functions to instruct STAAD.Pro to cancel the operation of the Cancelbutton was clicked:

    ElseIfdlgResult = 0 Then

    Debug.Print Cancel button PressedEnd If

    4. Keep this model open for the next exercise.

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    7/12Copyright 2012 Bentley Systems, Incorporated 7

    Get the Selected Node Information

    Learn to obtain the selected node information from the STAAD.Pro main application.

    1. Continue with the model from the previous exercise.

    2. Enter the following functions to determine if any nodes have been selected in the main application:

    DimNumSelNodesAs Long

    DimSelNodeArray()As Long

    NumSelNodes = objSTAADGUI.Geometry.GetNoOfSelectedNodes()

    IfNumSelNodes > 0 Then

    ReDimSelNodeArray(NumSelNodes)

    objSTAADGUI.Geometry.GetSelectedNodes(SelNodeArray, 1)

    Else

    MsgBoxPlease Select Nodes, vbOKOnly

    Exit Sub

    End If

    3. Enter the following functions to get the nodal displacements for the selected nodes:

    DimjAs Integer

    DimNodeNoAs Long

    DimDisplArray(6)As Double

    DimMaxDisplArray(6)As Double

    DimNodeArray(6)As String

    Fori = 0 ToNumSelNodes-1

    NodeNo = SelNodeArray(i)

    objSTAADGUI.Output.GetNodeDisplacements(NodeNo, LoadCase, DisplArray())

    Forj = 0 To5

    If Abs(DisplArray(j)) >Abs(MaxDisplArray(j)) Then

    MaxDisplArray(j) = Round(DisplArray(j), 3)

    NodeArray(j) = N & CStr(NodeNo)

    End If

    Nextj

    Nexti

    4. Keep this model open for the next exercise.

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    8/12Copyright 2012 Bentley Systems, Incorporated 8

    Retrieve the Base Units Configuration

    Learn to retrieve the base units configuration that has been specified in the main application.

    1. Continue with the model from the previous exercise.

    2. Enter the following functions to determine the base units configuration that were specified in the STAAD.Pro Start Page.

    DimBaseUnitAs Integer

    BaseUnit = objSTAADGUI.GetBaseUnit

    IfBaseUnit = 1 Then

    BaseLengthUnit = in

    Else

    BaseLengthUnit = m

    End If

    3. Keep this model open for the next exercise.

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    9/12

    Copyright 2012 Bentley Systems, Incorporated 9

    Return the Maximum Deflection Results

    Learn to obtain the maximum deflection results for the selected nodes and the selected load case.

    1. Continue with the model from the previous exercise.

    Note: In this exercise, we will create the following user dialog to display the maximum deflection of the selected nodes:

    2. Click on the Edit User Dialogicon.

    3. Double-click anywhere within the new dialog in the UserDialog Editor.

    4. Enter the following information into the Edit UserDialog Propertiesdialog:

    Caption: Maximum Deflection

    Then, click on the double right arrowbutton to enter the name of the dialog box.

    5. Use the Add Texttool to add the following text fields to the dialog:

    Load Case:

    X:

    Y:

    Z:

    Note: Ensure that the Quotedfield is selected when defining the text fields.

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    10/12

    Copyright 2012 Bentley Systems, Incorporated 10

    6. Use the Add Texttool to add the following text fields to the dialog:

    LoadCaseName

    CStr(MaxDisplArray(0))

    CStr(MaxDisplArray(1))

    CStr(MaxDisplArray(2))

    BaseLengthUnit

    NodeArray(0)

    NodeArray(1)

    NodeArray(2)

    Note: Ensure that the Quotedfield is not selected and the Fieldparameter is left blank when defining the text fields for the variables.

    7. Click on the Add OK Buttonicon in the New UserDialog Editor. Then, click within the new dialog to define the OK button.

    8. Click on the Save and Editicon in the New UserDialog Editor.

    9. Redefine the User Dialog by changing the last two lines in the macro to the following:

    Dimdlg2As UserDialog

    Dialog dlg2

    10. Terminate the Macro:

    Set objSTAADGUI = Nothing

    End Sub

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    11/12

    Copyright 2012 Bentley Systems, Incorporated 11

    Add the Nodal Deflections Macro to the Toolbar

    Learn to add a macro to the user tools in the toolbar.

    1. Continue with the model from the previous exercise.

    2. ClickTools > Configure User Tools...in the menu bar.

    3. Click on the New (Insert)icon in the Customize User Defined Toolsdialog.

    4. Enter the name Training_Nodal Deflection into the Menu Itemswindow.

    5. Click on the ... button adjacent to the Command string in the Customize User Defined Toolsdialog.

    6. Navigate to the Training_Nodal Deflections.vbsfile you just created in the Select Filedialog. Then, click Open.

    7. Click OKin the Customize User Defined Toolsdialog.

    8. Keep this model open for the next exercise.

  • 7/25/2019 OpenSTAADFundamentals_PracticeWorkbook2_ObtainingOutput.pdf

    12/12

    Copyright 2012 Bentley Systems, Incorporated 12

    Analyze the Model and Run the Macro

    Learn to analyze the model in the main application and run the macro.

    1. Continue with the model from the previous exercise.

    2. Click Analyze > Run Analysis... in the menu bar.

    3. Select the Stay in Modeling Moderadio button in the STAAD Analysis and Designdialog. Then, click Done.

    4. Click Select > By All > All Nodesin the menu bar.

    5. Click on the User Toolsicon in the Filetoolbar. Then, select Training_Node Displacements from the pull down menu.

    6. Highlight the Wind Loadcase in the Select Load Casedialog. Then, click OK.

    Note: Notice that the Maximum Deflectiondialog has now returned the maximum translational deflection in the X, Y, and Z axis globaldirections and the corresponding node number.

    7. Click OKin the Maximum Deflectiondialog.