Is there anyway to load tcl file into OpenSeesPy model?

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
MikeITExpert
Posts: 24
Joined: Sat Aug 21, 2021 9:19 pm

Is there anyway to load tcl file into OpenSeesPy model?

Post by MikeITExpert »

Hi All,

I am working with Civil engineer to automate some model analysis for him using Python. However, I don't know how to import his tcl files into Python.

I googled here and there and couldn't find anything relevant.

Please let me know your comments.
mhscott
Posts: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Is there anyway to load tcl file into OpenSeesPy model?

Post by mhscott »

This script does basic conversions of OpenSees Tcl to OpenSees Python. It assumes the input is line by line and there are no variables or constructs like loops or if statements. The script is not perfect, but it'll get you most of the way there.

https://github.com/OpenSees/OpenSees/bl ... nSeesPy.py
MikeITExpert
Posts: 24
Joined: Sat Aug 21, 2021 9:19 pm

Re: Is there anyway to load tcl file into OpenSeesPy model?

Post by MikeITExpert »

mhscott wrote: Sun Aug 22, 2021 7:15 am This might be useful too: https://portwooddigital.com/2021/06/20/ ... or-python/
This one was the best approach so far ... I wish there was a Python driver for OpenSees.exe to pass commands using PIPE and retrieve the results from output pipe.

This way I could use python to drive OpenSees analysis and I didn't have to convert all the tcl files to OpenSeesPy or O3SeesPy.

Anyway thanks for the response!
mhscott
Posts: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Is there anyway to load tcl file into OpenSeesPy model?

Post by mhscott »

Good to hear. When you develop something, please share with the OpenSees community.
Post Reply