Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intermediate Forces in OpenSTAAD

Status
Not open for further replies.

boyq

Civil/Environmental
Feb 11, 2012
3
Hi. I'm new to OpenSTAAD. I wanted to output a table for Section Forces at given distance which is not covered by STAAD default increments(up to 12).

I know I could use "Print Member Sections Force List" Command and defining a custom section but the output is not usable in excel since it's not tabulated so I thought of utilizing STAAD's built-in macro.

Here's my code that doesn't work:

Sub Main()
'Description:Intermediate Forces

Dim objOpenSTAAD AS Object
Dim beam As Long
Dim dist As Double
Dim LC As Long
Dim Force(0 TO 5) As Double

Set objOpenSTAAD = GetObject(,"Staad.ProOpenSTAAD")

beam = 120
LC = 701
For dist = 0 TO 3 Step 0.467
'Get Intermediate Forces for Member 120 (Length=3m) at 1.4m for LC 701
objOpenSTAAD.Output.GetIntermediateMemberForcesAtDistance (beam, dist, LC, Force(0))
Next dist
Set objOpenSTAAD = Nothing

End Sub


Your suggestions are appreciated.
 
Replies continue below

Recommended for you

I just utilized convert text-to-column wizard of MsExcel instead and it was now able to tabulate staad output data to my worksheet.

Consider this as solved.

Structural Engineer
 
Dear boyq

This is OpenSTAAD code in Excel for taking output results


Option Explicit

Sub Main()
'Description:Intermediate Forces

Dim objOpenSTAAD As Object
Dim BeamNo As Long
Dim Dist As Double
Dim LC As Long
Dim Force(0 To 5) As Double
Dim x As Integer

Set objOpenSTAAD = GetObject(, "StaadPro_OpenSTAAD")

BeamNo = 230
LC = 3
x = 0

For Dist = 0 To 3 Step 0.467
'Get Intermediate Forces for Member 120 (Length=3m) at 1.4m for LC 701
objOpenSTAAD.Output.GetIntermediateMemberForcesAtDistance BeamNo, Dist, LC, Force()

Worksheets(ActiveSheet.Name).Cells(3 + x, 1).Value = Dist
Worksheets(ActiveSheet.Name).Cells(3 + x, 2).Value = Force(0) '******FX
Worksheets(ActiveSheet.Name).Cells(3 + x, 3).Value = Force(1) '******FY
Worksheets(ActiveSheet.Name).Cells(3 + x, 4).Value = Force(2) '******FZ
Worksheets(ActiveSheet.Name).Cells(3 + x, 5).Value = Force(3) '******MX
Worksheets(ActiveSheet.Name).Cells(3 + x, 6).Value = Force(4) '******MY
Worksheets(ActiveSheet.Name).Cells(3 + x, 7).Value = Force(5) '******MZ
x = x + 1
Next Dist

Worksheets(ActiveSheet.Name).Cells(3, 1).Value = "Dist"
Worksheets(ActiveSheet.Name).Cells(3, 2).Value = "FX"
Worksheets(ActiveSheet.Name).Cells(3, 3).Value = "FY"
Worksheets(ActiveSheet.Name).Cells(3, 4).Value = "FZ"
Worksheets(ActiveSheet.Name).Cells(3, 5).Value = "MX"
Worksheets(ActiveSheet.Name).Cells(3, 6).Value = "MY"
Worksheets(ActiveSheet.Name).Cells(3, 7).Value = "MZ"

Worksheets(ActiveSheet.Name).Range(Cells(3, 1), Cells(3, 7)).Font.Bold = True
Worksheets(ActiveSheet.Name).Range(Cells(3, 1), Cells(2 + x, 7)).HorizontalAlignment = xlCenter
Worksheets(ActiveSheet.Name).Range(Cells(3, 1), Cells(2 + x, 7)).VerticalAlignment = xlCenter
Worksheets(ActiveSheet.Name).Range(Cells(3, 1), Cells(2 + x, 7)).NumberFormat = "0.000"

Set objOpenSTAAD = Nothing

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor