OS. To initialize OpenSTAAD and calculate the node coordinates
-
Type the following command to initialize
OpenSTAAD:
Dim objOpenSTAAD As Object Set objOpenSTAAD = GetObject(,"StaadPro.OpenSTAAD")
This command opens the connection to STAAD.Pro and the model currently open in the program.Note: You can initialize OpenSTAAD to any variable. Here,objOpenSTAAD
is used. -
Type the following commands to reference the
geometry
class in a variable:Dim geometry As OSGeometryUI Set geometry = objOpenSTAAD.Geometry
-
Type the following two
For
loops to calculate the nodal coordinates for each node in the frame.Note: There are two nested loops used because this is a 2D frame. The Z coordinate was previously set to zero and will not change.'Nodes For j = 2 To (row + 2) For i = 1 To (clmn + 1) crdx = (i - 1) * wdth geometry.AddNode crdx, crdy, crdz Next crdy = (j - 1) * ht Next
Note: TheNext
command to close theFor
loop is added automatically once you press Enter after typing theFor
command line. -
Type the following commands to reference the
support
class in a variable:Dim support As OSSupportUI Set support = objOpenSTAAD.Support
-
Type the following
If ElseIf
statement to get the desired support type.The support is created and the returned support reference number is stored to the variables1
.A
fall back
possibility is also added in case neither of the intended support types is somehow specified, then an error message is presented to the user.'Supports If sprt = "0" Then s1 = support.CreateSupportFixed() ElseIf sprt = "1" Then s1 = support.CreateSupportPinned() Else MsgBox("Select Proper Support Type",vbOkOnly,"Error") Exit Sub End If
Note: The OpenSTAAD commandsupport.CreateSupportFixed
can also be used to simply create a new support without using the return value. But by adding the parenthesis at the end, the script can take the returned support reference number which allows you to store that in the variable. -
Type the following line to add a debugging statement for the
returned support reference number:
Debug.Print "Support return value = ";s1
-
Type the following type to assign the support types to the bottom
nodes in the frame:
For i1 = 1 To (clmn + 1) support.AssignSupportToNode i1,s1 Next
Tip: Now is a good time to save the work
done to this point.