This is the program I wrote for finding support reactions in node 1 for loadcase 1001, but on running I am getting input as 6 zeroes, please help me how to correct it.
Private Sub CommandButton1_Click()Dim objOpenSTAAD As ObjectDim A(6) As DoubleSet objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")objOpenSTAAD.Output.GetSupportReactions 1, 1001, AFor b = 1 To 6Range("b2").Offset(0, b - 1) = A(b - 1)Next bEnd Sub
Thanks
Jaseel
Please write your code as:
Private Sub CommandButton1_Click()Dim objOpenSTAAD As ObjectDim A(6) As DoubleSet objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
Dim node As LongDim LoadCase As Longnode = 1LoadCase = 1001
objOpenSTAAD.Output.GetSupportReactions node, LoadCase, AFor b = 1 To 6Range("b2").Offset(0, b - 1) = A(b - 1)Next bEnd Sub
Answer Verified By: Jaseel K
You can also indicate that the numbers are type long by putting an ampersand after them thus:
objOpenSTAAD.Output.GetSupportReactions 1&, 19&, A
then it will work.
Also, don't forget to release the memory used by the object at the end of your program by putting in this statement.
Set objOpenSTAAD = Nothing