OpenSTAAD V8i
The first thing necessary to access STAAD project data from within another application is to instantiate, or create an instance of OpenSTAAD within the other application. In Visual Basic for Applications (VBA), this may be done by creating an object variable and then assigning to it the OpenSTAAD object. The VBA GetObject function may be used for this.
The object which controls the STAAD.Pro environment is referred to as StaadPro.OpenSTAAD. This object must be created in order to get access to any of the internal graphical functions within STAAD.Pro (including the creating of menu items and dialog boxes) as well as access to STAAD’s viewing, geometry modeling, results grid, and post-processing functions. The following VBA function can be used to instantiate or create this object:
Set MyObject = GetObject("filepath", "ojbectclass")
Where:
Thus:
Set objName = GetObject("StaadPro.OpenSTAAD")
At the conclusion of your OpenSTAAD application, the OpenSTAAD object(s) should be terminated, to unlock the handles within the application to the OpenSTAAD functions, and to free system resources.
Sub How2Begin()
'Create a variable to hold your OpenSTAAD object(s).
Dim objOpenSTAAD As Object
'Launch OpenSTAAD Object
Set objOpenSTAAD = GetObject(, "StaadPro.OpenSTAAD")
'At the end of your application, remember to terminate the OpenSTAAD objects.
Set objOpenSTAAD = Nothing
End Sub