0% found this document useful (0 votes)
343 views3 pages

Macro For Design of Beam in Excel STAAD Pro

This document contains code to analyze results from an STAAD model. It launches the OpenSTAAD object, loads an STAAD file, gets the number of load cases and combinations, iterates through each load case to extract member end forces and maximum sagging moment, and writes the beam depth and width to cells. Key outputs include member forces, maximum moment, and beam dimensions.

Uploaded by

r____k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
343 views3 pages

Macro For Design of Beam in Excel STAAD Pro

This document contains code to analyze results from an STAAD model. It launches the OpenSTAAD object, loads an STAAD file, gets the number of load cases and combinations, iterates through each load case to extract member end forces and maximum sagging moment, and writes the beam depth and width to cells. Key outputs include member forces, maximum moment, and beam dimensions.

Uploaded by

r____k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Sub Examp8()

Dim objOpenSTAAD

Dim EndForces(6) As Double

Dim PrimaryLCs As Integer

Dim LoadCombs As Integer

Dim Depth As Double

Dim Width As Double

Dim MemberNo As Long

Dim MaxSaggingMoment As Double

Dim Ax As Double, Ay As Double, Az As Double, Ix As Double, Iy As Double, Iz As Double

Dim LoadPrevious As Integer

Dim LoadNext As Integer

Dim strLoadName As String

'Launch OpenSTAAD Object

Set objOpenSTAAD = CreateObject("OpenSTAAD.Output.1")

'Load your STAAD file - make sure you have successfully run the file

objOpenSTAAD.SelectSTAADFile Cells(14, 2).Value

MemberNo = Cells(15, 2).Value

'Find out how many primary load cases and load combinations you have

objOpenSTAAD.GetPrimaryLoadCaseCount PrimaryLCs

Cells(2, 10).Value = PrimaryLCs

objOpenSTAAD.GetLoadCombinationCaseCount LoadCombs
Cells(3, 10).Value = LoadCombs

TotalLoads = PrimaryLCs + LoadCombs

'Iterate through your load sets to find the results for each load case

LoadPrevious = 0

For i = 1 To TotalLoads

objOpenSTAAD.GetNextLoadCase LoadPrevious, LoadNext, strLoadName

Cells(2, i + 1).Value = LoadNext

Cells(3, i + 1).Value = strLoadName

objOpenSTAAD.GetMemberEndForces MemberNo, 0, LoadNext, EndForces(0)

For j = 0 To 5

'Print the result values in specified cells

Cells(j + 4, i + 1).Value = EndForces(j)

Next

objOpenSTAAD.GetMinBendingMoment MemberNo, "MZ", LoadNext, MaxSaggingMoment

Cells(10, i + 1).Value = MaxSaggingMoment

LoadPrevious = LoadNext

Next

'Write the appropriate dimensions (for the beam) in the correct cells

Sheets("Concrete").Select

'Get Depth and Width of Concrete Beam

'objOpenSTAAD.GetMemberProperties MemberNo, Width, Depth, Ax, Ay, Az, Ix, Iy, Iz

objOpenSTAAD.GetMemberWidthAndDepth MemberNo, Width, Depth

'Depth

Cells(32, 7).Value = Depth

'Width
Cells(31, 7).Value = Width

objOpenSTAAD.CloseSTAADFile

Set objOpenSTAAD = Nothing

End Sub

You might also like