STAAD.Pro Help

OS. To initialize OpenSTAAD and calculate the node coordinates

  1. 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.
  2. Type the following commands to reference the geometry class in a variable:
            Dim geometry As OSGeometryUI
            Set geometry = objOpenSTAAD.Geometry
  3. 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.
            For j = 2 To (row + 2)
                For i = 1 To (clmn + 1)
                    crdx = (i - 1) * wdth
                    geometry.AddNode crdx, crdy, crdz
                crdy = (j - 1) * ht
    Note: The Next command to close the For loop is added automatically once you press <Enter> after typing the For command line.
  4. Type the following commands to reference the support class in a variable:
            Dim support As OSSupportUI
            Set support = objOpenSTAAD.Support
  5. 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 s1.

    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.

            If sprt = "0" Then
                s1 = support.CreateSupportFixed()
            ElseIf sprt = "1" Then
                s1 = support.CreateSupportPinned()
                MsgBox("Select Proper Support Type",vbOkOnly,"Error")
                Exit Sub
            End If
    Note: The OpenSTAAD command support.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.
  6. Type the following line to add a debugging statement for the returned support reference number:
            Debug.Print "Support return value = ";s1
  7. 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
Tip: Now is a good time to save the work done to this point.