-
Type
OpenSTAADUI.OSGeometryUI geometry =
os.Geometry;
and then press Return.
This defines the geometry variable as the Geometry group of
methods in OpenSTAAD.
-
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.
-
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();
}
}
}