OS. Use Geometry Methods

  1. Type OpenSTAADUI.OSGeometryUI geometry = os.Geometry; and then press Return.

    This defines the geometry variable as the Geometry group of methods in OpenSTAAD.

  2. Type int nodeCount = geometry.GetNodeCount(); and then press Return.

    This uses the OpenSTAAD method GetNodeCount() to return the number of nodes in the active STAAD.Pro model into the specified variable.

  3. Type int beamCount = geometry.GetMemberCount(); and then press Return.

    Similarly, this uses the OpenSTAAD method GetMemberCount() to return the number of members in the active STAAD.Pro model into the specified variable.

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;
            	OpenSTAADUI.OSGeometryUI geometry = os.Geometry;
            	int nodeCount = geometry.GetNodeCount();
           	 int beamCount = geometry.GetMemberCount();
            	}
        }
    }