Hi,

I have been trying to extract model details via OpenSTAAD, but it is showing error right from the start (Error 438)... The code is as below

Private Sub CommandButton1_Click()

Dim openSTAADObj As Object

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

openSTAADObj.OpenSTAADFile "D:\STD-Files\Str7.std"

'==========================NODES===============================

Dim nNodes As Long

nNodes = openSTAADObj.Geometry.GetNodeCount

Dim nodesList() As Long

openSTAADObj.Geometry.GetNodeList nodesList()

Dim xCoord As Double

Dim yCoord As Double

Dim zCoord As Double

For i = 1 To nNodes-1

openSTAADObj.Geometry.GetNodeCoordinates (nodesList(i - 1)), xCoord, yCoord, zCoord

Worksheets("Sheet2").Range("A" & (i + 3)) = nodesList(i - 1)

Worksheets("Sheet2").Range("B" & (i + 3)) = xCoord

Worksheets("Sheet2").Range("C" & (i + 3)) = yCoord

Worksheets("Sheet2").Range("D" & (i + 3)) = zCoord

Next i

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

Set openSTAADObj = Nothing

End Sub

The line giving the error is shown bold above ... The function used is as documented: (see attached)

Please, anyboby, any idea what the problem is?

Rahul Leslie

More Rahul Leslie's questions See All
Similar questions and discussions