openstaadfundamentals_practiceworkbook1_generatinggeometry.pdf

21
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 1: Generating Geometry OpenSTAAD Fundamentals - July 2012 DO NOT DISTRIBUTE - Printing for Student use is Permitted

Upload: welcomepopefrancis

Post on 07-Jul-2016

218 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Bentley Institute Training

Practice WorkbookThis 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 1: Generating Geometry

OpenSTAAD Fundamentals - July 2012

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Billy.Bellefleur
Typewritten Text
TRN020150-1/0001-PW01
Billy.Bellefleur
Typewritten Text
Billy.Bellefleur
Typewritten Text
Billy.Bellefleur
Typewritten Text
Billy.Bellefleur
Typewritten Text
Billy.Bellefleur
Typewritten Text
Billy.Bellefleur
Typewritten Text
Billy.Bellefleur
Typewritten Text
Billy.Bellefleur
Typewritten Text
Page 2: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 2

Create a New STAAD.Pro Model

Learn to create a new STAAD.Pro model and specify the units configuration and the current input units.

1. Launch STAAD.Pro. The Start Page will be displayed by default.

2. Click on the Configuration... link in the Project Tasks Area.

3. Select the Base Unit tab in the Configure Program dialog. Then enter the following parameter:

Select Base Unit: English

Click the Accept button.

4. Click on the New Project... link in the Project Tasks Area.

5. Enter the following information in the New dialog:

Structure Type: Space

File Name: Box Girder Structure

Length Units: Foot

Force Unit: KiloPound

6. Click on the (...) button and navigate to the location of the dataset. Then, click OK.

7. Click on the Next > button in the New dialog.

8. Click on the Finish button in the Where do you want to go? dialog.

9. Click on the Input Units icon tn the Structure toolbar.

10. Enter the following parameters in the Set Current Input Units dialog:

Length Units: Foot

Force Units: KiloPound

Click the OK button.

11. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 3: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Initiate OpenSTAAD

Learn to create a new macro, initiate OpenSTAAD, and display the OpenSTAAD function in the Object Browser.

1. Continue with the model from the previous exercise.

2. Click on the Run VB Macro icon in the File toolbar.

3. Click on the Create New button in the Macro dialog.

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

File Name: Training_Box Girder

Save as Type: Macro Files (*.vbs)

Description of the Macro: Generate a Parabolic Box Structure

Click on the New button.

5. Enter the following function to initiate OpenSTAAD:

Sub Main()‘DESCRIPTION:Generate a Parabolic Box Girder Structure

Set objSTAADGUI = GetObject (,”STAADPro.OpenSTAAD”)

End Sub

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

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

8. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 4: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 4

Retrieve the Base Units Configuration and the Input Units

Learn to retrieve the base units configuration and the input units from the current STAAD.Pro model.

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.

Dim BaseUnit As IntegerBaseUnit = objSTAADGUI.GetBaseUnitIf BaseUnit = 1 Then

BaseLengthUnit = “in”Else

BaseLengthUnit = “m”End If

Note: If this function returns a value of 1, the units configuration in the main application is currently set to English, which would correspond to inches and kilopounds. If this function returns a value of 2, the units configuration is currently set to Metric, which would correspond to meters and kilonewtons.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 5: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 5

3. Enter the following functions to determine the input length units that were specified in the STAAD.Pro main application:

Dim LengthUnit As IntegerLengthUnit = objSTAADGUI.GetInputUnitForLengthIf LengthUnit = 0 Then

InputLengthUnit = "in"ElseIf LengthUnit = 1 Then

InputLengthUnit = "ft"ElseIf LengthUnit = 2 Then

InputLengthUnit = "ft"ElseIf LengthUnit = 3 Then

InputLengthUnit = "cm"ElseIf LengthUnit = 4 Then

InputLengthUnit = "m"ElseIf LengthUnit = 5 Then

InputLengthUnit = "mm"ElseIf LengthUnit = 6 Then

InputLengthUnit = "dm"ElseIf LengthUnit = 7 Then

InputLengthUnit = "km"End If

4. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 6: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 6

Create the Geometry Input Dialog

Learn to create a dialog to be used in the STAAD.Pro main application to enter the geometric parameters.

1. Continue with the model from the previous exercise.

2. Click on the Edit User Dialog icon.

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

4. Enter the following information into the Edit UserDialog Properties dialog:

Caption: Box Girder Variables

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

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

6. Enter the following information into the Edit Text Properties dialog:

Caption: Number of Divisions:

Quoted: (checked)

Click on the double right arrow button to enter the name of the field. Then, click Cancel.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 7: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 7

7. Repeat this process to add the following fields to the dialog:

Maximum Pier Height:

Minimum Pier Height:

Span Length:

Span Width:

Plate Thickness:

8. Click on the Add Text icon in the UserDialog Editor. Click within the new dialog to define the text location and then double-click within the new text field.

9. Enter the following information into the Edit Text Properties dialog:

Caption: BaseLengthUnit

Quoted: (unchecked)

Field: (leave blank)

Click on the double right arrow button to enter the name of the field. Then, click Cancel.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 8: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 8

10. Repeat this process to add the BaseLengthUnit and the InputLengthUnit variables adjacent to the appropriate fields:

11. Click on the Add TextBox icon in the UserDialog Editor. Click within the new dialog to define the text box location and then double-click within the new text box.

12. Enter the following information into the Edit TextBox Properties dialog:

Field: nDivisions

Click on the double right arrow button to enter the name of the text box. Then, click Cancel.

13. Repeat this process to add the following text boxes to the dialog:

MaxHeight

MinHeight

SpanLength

SpanWidth

PlateThick

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 9: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 9

Note: The input variables in the Box Girder Variables dialog will be used to define the geometry of the parabolic box structure:

Note: All of the variables used in this dialog, with the exception of the Plate Thickness, are interpreted by OpenSTAAD using the base units configuration. The Plate Thickness, however, is interpreted using the current input unit for length.

MaxHeightMinHeight

SpanLength

SpanWidth

nDivisions = number of plates to be generated along each side of the structure over the span length

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 10: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 10

14. Click on the Add OK Button icon in the New UserDialog Editor. Then, click within the new dialog to define the OK button.

15. Click on the Add Cancel Button icon in the New UserDialog Editor. Then, click within the new dialog to define the Cancel button.

16. Click on the Save and Edit icon in the New UserDialog Editor.

17. Delete the last line of this code (“Dialog dlg”).

18. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 11: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 11

Define the Input Variables

Learn to define the input variables that were used in the Box Girder Variables dialog.

1. Continue with the model from the previous exercise.

2. Enter the following functions to define the input variables that were used in the Box Girder Variables dialog.

Dim nDivisions As IntegerDim MaxHeight As DoubleDim MinHeight As DoubleDim SpanLength As DoubleDim SpanWidth As DoubleDim PlateThick As Double

3. Enter the following functions to instruct STAAD.Pro to get the input values if the OK button was clicked:

Dim dlgResult As IntegerdlgResult = Dialog(dlg)If dlgResult = -1 Then

nDivisions = Abs(CInt(dlg.nDivisions))MaxHeight = Abs(CDbl(dlg.MaxHeight))MinHeight = Abs(CDbl(dlg.MinHeight))SpanLength = Abs(CDbl(dlg.SpanLength))SpanWidth = Abs(CDbl(dlg.SpanWidth))PlateThick = Abs(CDbl(dlg.PlateThick))

4. Enter the following functions to instruct STAAD.Pro to cancel the operation of the Cancel button was clicked:

ElseIf dlgResult = 0 ThenDebug.Print “Canel button Pressed”

End If

5. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 12: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 12

Define the Model Geometry

Learn to create a macro to define the model geometry.

1. Continue with the model from the previous exercise.

2. Enter the following functions to determine the number of nodes required to generate the structure:

Dim NumOfNodes As Integer

Dim NodeX() As DoubleDim NodeY() As DoubleDim NodeZ() As DoubleDim STAADNodeNos() As Long

NumOfNodes = nDivisions + 1

ReDim NodeX(NumOfNodes) As DoubleReDim NodeY(NumOfNodes) As DoubleReDim NodeZ(NumOfNodes) As DoubleReDim STAADNodeNos(NumOfNodes*4) As Long

Note: The first step in generating the geometry is to define the total number of nodes to be generated by this macro. The number of divisions (nDivisions variable) was specified in the Box Girder Variables dialog. By multiplying the number of divisions (plus 1) by 4, we will arrive at the total number of nodes required for the parabolic box girder structure.

nDivisions = number of plates to be generated along each side of the structure over the span length

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 13: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 13

3. Enter the following functions to calculate the Y values that make up the bottom side of the parabola.

Dim A As DoubleA = -MinHeight / ((SpanLength/2)*(SpanLength/2))

Dim H As DoubleH = SpanLength/2

Dim N As IntegerFor N = 1 To NumOfNodes

NodeX(N) = (N-1)*SpanLength/nDivisionsNodeY(N) = ((NodeX(N)-H)*(NodeX(N)-H))*A + MinHeight

Note: For this exercise, we will use the following equation to define the parabola for the bottom surface of the structure:Y = A (X - H)2 + K, where K = MinHeight.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 14: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 14

4. Enter the following function to generate the nodes for the parabola at Z = 0:

objSTAADGUI.Geometry.AddNode(NodeX(N), NodeY(N),0)

5. Enter the following function to generate the nodes for the parabola at Z = Span Width:

objSTAADGUI.Geometry.AddNode(NodeX(N), NodeY(N), SpanWidth)

6. Enter the following function to generate the nodes for the straight top at Z = 0:

objSTAADGUI.Geometry.AddNode(NodeX(N), MaxHeight, 0)

7. Enter the following function to generate the nodes for the straight top at Z = Span Width:

objSTAADGUI.Geometry.AddNode(NodeX(N), MaxHeight, SpanWidth)

Next N

Note: Steps 4 - 7 will generate the nodes for each side of the parabolic box structure.

Step #4

Step #5

Step #6

Step #7

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 15: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 15

8. Enter the following functions to generate the Side Plates for each box section:

For N = 1 To NumOfNodes

objSTAADGUI.Geometry.AddPlate((2+4*(N-1)), (6+4*(N-1)), (8+4*(N-1)), (4+4*(N-1)))objSTAADGUI.Geometry.AddPlate((1+4*(N-1)), (3+4*(N-1)), (7+4*(N-1)), (5+4*(N-1)))

9. Enter the following function to generate the Top Plate for each box section:

objSTAADGUI.Geometry.AddPlate((4+4*(N-1)), (8+4*(N-1)), (7+4*(N-1)), (3+4*(N-1)))

10. Enter the following function to generate the Bottom Plate for each box section:

objSTAADGUI.Geometry.AddPlate((1+4*(N-1)), (2+4*(N-1)), (6+4*(N-1)), (5+4*(N-1)))

Next N

Note: Steps 8 - 10 will generate the plates using the nodes that were generated through steps 4 - 7.

11. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 16: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 16

Define the Plate Thickness and Material

Learn to define the plate thickness and assign the concrete material to the plate.

1. Continue with the model from the previous exercise.

2. Enter the following functions to define the number of plates:

Dim NumOfPlates As IntegerNumOfPlates = nDivisions * 4

3. Enter the following functions to define the plate thickness in the Properties dialog:

Dim PlatePropertyNo As LongPlatePropertyNo = objSTAADGUI.Property.CreatePlateThicknessProperty (PlateThick)

4. Enter the following functions to assign the plate thickness and concrete material to all of the plates in the model:

Dim P As IntegerFor P = 1 To NumOfPlates

objSTAADGUI.Property.AssignPlateThickness(P, PlatePropertyNo)objSTAADGUI.Property.AssignMaterialToPlate("CONCRETE",P)

Next P

5. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 17: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 17

Assign Fixed Supports to the End Nodes

Learn to use a macro to assign fixed supports to the end nodes.

1. Continue with the model from the previous exercise.

2. Enter the following functions to create a fixed support:

Dim SupportNo As LongSupportNo = objSTAADGUI.Support.CreateSupportFixed

3. Enter the following functions to assign the fixed support to the first four nodes:

Dim NodeNo As LongFor NodeNo = 1 To 4objSTAADGUI.Support.AssignSupportToNode (NodeNo, SupportNo)Next NodeNo

4. Enter the following functions to assign the fixed support to the last four nodes:

For NodeNo = (4 * NumOfNodes - 3) To (4 * NumOfNodes)objSTAADGUI.Support.AssignSupportToNode (NodeNo, SupportNo)Next NodeNo

5. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 18: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 18

Create the Dead and Live Load Cases

Learn to use a macro to create the Dead Load and the Live Load primary load cases.

1. Continue with the model from the previous exercise.

2. Enter the following functions to generate the dead load case:

Dim DeadLoadNo As LongDeadLoadNo = objSTAADGUI.Load.CreateNewPrimaryLoad (“Dead Load”)

objSTAADGUI.Load.SetLoadActive (DeadLoadNo)

Dim DeadLoadType As IntegerDeadLoadType = 0objSTAADGUI.Load.SetLoadType(DeadLoadNo, DeadLoadType)

3. Enter the following functions to generate the live load case:

Dim LiveLoadNo As LongLiveLoadNo = objSTAADGUI.Load.CreateNewPrimaryLoad (“Live Load”)

objSTAADGUI.Load.SetLoadActive (LiveLoadNo)

Dim LiveLoadType As IntegerLiveLoadType = 1objSTAADGUI.Load.SetLoadType(LiveLoadNo, LiveLoadType)

4. Enter the following functions to update the structure and terminate the macro:

objSTAADGUI.UpdateStructureSet objSTAADGUI = Nothing

End Sub

5. Click on the Save icon in the Macro Design Window. Then, close the Macro Design Window.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 19: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 19

Add the Box Girder 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. Click Tools > Configure User Tools... in the menu bar.

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

4. Enter the name Training_Box Girder into the Menu Items window.

5. Click on the “...” button adjacent to the Command string in the Customize User Defined Tools dialog.

6. Navigate to the Training_Box Girder.vbs file you just created in the Select File dialog. Then, click Open.

7. Click OK in the Customize User Defined Tools dialog.

8. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 20: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 20

Run the Macro and Define the Geometry

Learn to run the macro and enter all of the appropriate input variables.

1. Continue with the model from the previous exercise.

2. Click on the User Tools icon in the File toolbar. Then, select Training_Box Girder from the pull down menu.

3. Enter the following parameters into the Box Girder Variables dialog:

Number of Divisions: 20

Maximum Pier Height: 20 inches

Minimum Pier Height: 10 inches

Span Length: 300 inches

Span Width: 30 inches

Plate Thickness: 1 foot

Click OK.

4. Keep this model open for the next exercise.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed

Page 21: OpenSTAADFundamentals_PracticeWorkbook1_GeneratingGeometry.pdf

Copyright © 2012 Bentley Systems, Incorporated 21

Review the Generated Geometry

Learn to review the goemetry and paramters generated using the macro.

1. Continue with the model in the previous exercise.

2. Click on the Geometry tab and the Plate sub-tab in the Page Control Area.

Notice that STAAD.Pro has successfully generated the nodes and plates for the parabolic box structure per the input parameters.

3. Click on the General tab and the Property sub-tab in the Page Control Area.

Notice that STAAD.Pro has successfully assigned the plate thickness and the concrete material to the plates in the structure.

4. Click on the General tab and the Support sub-tab in the Page Control Area.

Notice that STAAD.Pro has successfully assigned fixed supports to the end nodes of the structure.

5. Click on the General tab and the Load & Duration sub-tab in the Page Control Area.

Notice that STAAD.Pro has successfully assigned the dead load and the live load primary load cases.

DO

NO

T D

ISTR

IBU

TE -

Prin

ting

for S

tude

nt u

se is

Per

mitt

ed