OS. To initialize OpenSTAAD and calculate the node coordinates
Type the following command to initialize
This command opens the connection to STAAD.Pro and the model currently open in the program.
Dim objOpenSTAAD As Object Set objOpenSTAAD = GetObject(,"StaadPro.OpenSTAAD")
Type the following commands to reference the geometry class in
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
Type the following commands to reference the support class in
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 variable
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
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