Quantcast
Channel: RAM | STAAD Forum - Recent Threads
Viewing all articles
Browse latest Browse all 16762

OPEN STAAD - Results Function not working

$
0
0

Dear sir,

I am trying to develop a VBA macro in Excel in order to retrieve supports reactions from Staad Pro (v20.07.11.82).

The following code is used, with OpenSTAAD functions in bold:

 

'Staad Object and Results opening

'=================================

'Get the application object

Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")

'

'Counting support nodes

'======================

iSupportCount = objOpenSTAAD.Support.GetSupportCount

ReDim lSupportNodesArray(0 To (iSupportCount - 1)) As Long

objOpenSTAAD.Support.GetSupportNodes lSupportNodesArray

'

'Filling Foundation loads table

'==============================

For i = 0 To UBound(lSupportNodesArray)

    Cells(Ligne1 + i * 3, Colonne1).Value = lSupportNodesArray(i)

    For j = 3 To 3 + lPrimaryLoadCaseCount - 1

            objOpenSTAAD.Output.GetSupportReactions lSupportNodesArray(i), Cells(4, j).Value, dReactionArray

            Cells(3 * i + 5, j).Value = dReactionArray(1) * 4.4482216

            Cells(3 * i + 6, j).Value = -dReactionArray(0) * 4.4482216

            Cells(3 * i + 7, j).Value = -dReactionArray(2) * 4.4482216

    Next

Next

The Supports Applications functions GetSupportCount and GetSupportNodes are working properly: I am retrieving correctly the nodes numbers, so Excel is properly communicating with Staad. But the result function GetSupportReactions does not work: the array created is filled with zero values, while results are available. Is there a mistake in the code?

Thanks in advance for your help.

Pascal OGIER


Viewing all articles
Browse latest Browse all 16762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>