Warning
The class-based API is deprecated. The standalone classes (Root(), Geometry(),
Load(), Output(), Properties(), View(), Design(), Command(), Support()) are
deprecated in the 0.0.x releases and will be removed in 0.1.0. Instantiating any of
them now emits a FutureWarning. Use the new single-import session API instead:
from openstaad import ops → ops.connect(). See Migration below, or the full
migration guide.
openstaad python is a starting project to wrap the official OpenStaad API functionalities into a Python package.
It aims to facilitate the connection between StaadPRO and Python, avoiding boilerplate code and type management, allowing the user to focus on the real automation tasks.
openstaadis a Python package to call easily functions from the OpenStaad API.- Require a StaadPRO and a valid file open to connect
- MIT-License
- The intended audience is StaadPro users with knowledge of Python
- Compatibitity:
- Tested with Python 3.10.9
- Operating System: Windows 11
- Dependencies:
Basic installation by pip.
pip install openstaadFor the next example, a valid STAAD.Pro file should be open.
from openstaad import ops
# Connect to the running STAAD.Pro session (a valid .STD file must be open)
s = ops.connect()
# Function that returns a list
beam_list = s.GetBeamList()
# Function that returns a string
file_name = s.GetSTAADFile()
# Function that receives an argument
beam_number = 10
beam_nodes = s.GetMemberIncidence(beam_number)
print(beam_list)
print(file_name)
print(beam_nodes)The class-based API is deprecated and will be removed in 0.1.0. Migrating is almost entirely
mechanical: method names stay the same — you just consolidate the per-domain instances
(Geometry(), Root(), …) into a single session object returned by ops.connect() and route
every call through it.
# Legacy (deprecated)
from openstaad import Geometry, Root
geometry = Geometry()
root = Root()
beams = geometry.GetBeamList()
# New
from openstaad import ops
s = ops.connect()
beams = s.GetBeamList()A few methods need manual attention:
Renamed
GetElementGlobalOffset→GetElementGlobalOffSetGetElementOffsetSpec→GetElementOffSetSpecAddResponseSpectrumLoadEx→AddResponseSpectrumLoad(signature also changes:data_pairsmoves to the last argument)
Removed
IsRelease()— no direct replacement; callGetMemberReleaseSpecEx()and evaluate the result yourself.
Same name, different result (behavior changes)
- Coordinates and lengths are no longer rounded to 3 decimals — full precision is returned.
GetApplicationVersionno longer includes the"Version "prefix.GetAnalysisStatusdict key"CPUTime(sec)"is now"CPUTime".NewSTAADFileno longer creates subfolders and now requires three arguments.SaveModelparameter changed fromsilent: inttosaveSilent: bool.
Full guide: https://www.openstaad.com/docs/migration_guide.
The source code of openstaad can be found at GitHub, target your pull requests to the main branch:
https://github.com/OpenStaad/OpenStaadPython/pulls
Questions and feedback at GitHub Discussions: https://github.com/OpenStaad/OpenStaadPython/discussions
Issue tracker at GitHub: https://github.com/OpenStaad/OpenStaadPython/issues
Please always post questions at the forum to make answers available to other users as well.
Feedback is greatly appreciated.
Konrad