OS. Initiate OpenSTAAD in C#

  1. Add a namespace by typing: using System.Runtime.InteropServices;
    This namespace provides a wide variety of members that support COM interop and platform invoke services.
  2. Type OpenSTAADUI.OpenSTAAD os = Marshal.GetActiveObject("StaadPro.OpenSTAAD") as OpenSTAADUI.OpenSTAAD; and then press Return.
    This initiates OpenSTAAD and connects to the current STAAD.Pro model to your program.
Your program at this point should look like:
using System;
using System.Runtime.InteropServices;

namespace OSEOMConsoleApp
    {
    class Program
        {
        static void Main (string[] args)
            {
      OpenSTAADUI.OpenSTAAD os = Marshal.GetActiveObject("StaadPro.OpenSTAAD") as OpenSTAADUI.OpenSTAAD;
            }
        }
    }