Rahul Leslie
Structural
- Mar 17, 2018
- 17
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(, "StaadPrpenSTAAD")
openSTAADObj.OpenSTAADFile "D:\STD-Files\Str7.std"
'==========================NODES===============================
Dim nNodes As Long
nNodes = openSTAADObj.Geometry.GetNodeCount
Dim nodesList() As Long
[highlight #FCE94F]openSTAADObj.Geometry.GetNodeList nodesList()[/highlight]
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 highlighted above ... The function used is as documented:
Please, anyboby, any idea what the problem is?
Rahul Leslie
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(, "StaadPrpenSTAAD")
openSTAADObj.OpenSTAADFile "D:\STD-Files\Str7.std"
'==========================NODES===============================
Dim nNodes As Long
nNodes = openSTAADObj.Geometry.GetNodeCount
Dim nodesList() As Long
[highlight #FCE94F]openSTAADObj.Geometry.GetNodeList nodesList()[/highlight]
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 highlighted above ... The function used is as documented:
Please, anyboby, any idea what the problem is?
Rahul Leslie