tcl2py#
- opstool.preprocessing.tcl2py(input_file, output_file, prefix='ops', encoding='utf-8')[source]#
Convert tcl code of opensees to openseespy code.
Tip
This function will flatten your tcl code, including loops, judgments, assignments, proc, etc.
Do not use assignment statements for openseens commands, such as
set ok [analyze 1],set lambdaN [eigen 10], it will trigger an error!It is recommended to remove analysis related tcl code and keep only commands such as model building and load definition to avoid possible exceptions. The analysis-related python code you can add manually, although this function provides the ability to convert the analysis tcl code.
Parameters#
- input_filestr
The name of input
.tclfile.- output_filestr
The name of output
.pyfile.- prefixstr, optional
Prefix name of openseespy, by default
ops. i.e.,import openseespy.opensees as ops. If None or void str ‘’, the prefix is not used. i.e.,from openseespy.opensees import *.- encoding: str, optional
file encoding format, by default “utf-8”.