OS. Use Geometry Methods
-
After the mStaadObj declaration, type Dim
nodesCount As Integer and then press <Return>.
This dimensions the variable nodesCount as an integer.
-
Type Dim beamCount As Integer
and then press <Return>.
This dimensions the variable beamCount as an integer.
-
After the mStaadObj initiation, type nodesCount = mStaadObj.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 beamCount =
mStaadObj.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.
Tip: Reference the OpenSTAAD documentation for details on available methods and what values are accepted as input or returned from each.
Your program at this point should
look like:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim mStaadObj As Object
Dim nodesCount As Integer
Dim beamCount As Integer
mStaadObj = GetObject(, "StaadPro.OpenSTAAD")
nodesCount = mStaadObj.geometry.GetNodeCount()
beamCount = mStaadObj.geometry.GetMemberCount()
End Sub
End Class