How to Use the OpenSeesCommand classΒΆ

[1]:
# import OpenSeesPy and demo model
import openseespy.opensees as ops
from opsparser import OpenSeesParser
from ArchBridge2 import ArchBridge2
[2]:
# first hook all commands before your opensees code
parser = OpenSeesParser(ops)
parser.hook_all(debug = False) # Set debug = True to show parsing process

# feel free to run your OpenSeesPy Code
ArchBridge2()
[15]:
# OpenSeesCommand is an Enum class that provides easy access to manager instances
# It allows accessing managers through auto-completable keys

from opsparser import OpenSeesCommand as Command

# Access manager instances through enum values
# Each manager is a singleton - only one instance exists in the program
for cmd in Command:
    print(cmd.name, cmd)

NODE OpenSeesCommand.NODE
ELEMENT OpenSeesCommand.ELEMENT
MATERIAL OpenSeesCommand.MATERIAL
[ ]:
# let's check what commands each manager can handle
for cmd in Command:
    instance = cmd.instance
    print(instance)
NodeManager handles Commands: (node, mass, model)
ElementManager handles Commands: (element)
MaterialManager handles Commands: (uniaxialMaterial, nDMaterial)