Note: You must have a model open in STAAD.Pro for this
example. Otherwise your code will return an error.
-
Type the following statements and press Return at the end of each
statement:
from comtypes import automation
from comtypes import client
import ctypes
This uses the comtypes library
to allow you to use COM objects (such
as OpenSTAAD).
-
Type
os =
client.GetActiveObject("StaadPro.OpenSTAAD")
and then press
Return.
This initiates OpenSTAAD and connects to the
current STAAD.Pro model to your program.
Your program at this point should look
like:from comtypes import automation
from comtypes import client
import ctypes
os = client.GetActiveObject("StaadPro.OpenSTAAD")