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.
  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.
            '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
  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.

            '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
  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
            Next