OS. Using functions that only return a single value

  1. Type 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.

  2. Type 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:

Python

from comtypes import automation
from comtypes import client
import ctypes
os = client.GetActiveObject("StaadPro.OpenSTAAD")
geometry = os.Geometry
geometry._FlagAsMethod("GetNodeCount")
geometry._FlagAsMethod("GetMemberCount")
nodeCount = geometry.GetNodeCount
beamCount = geometry.GetMemberCount