Is it possible to run a sofistik calculation (teddy input) , using the sofistik python interface?
The interfaces are (Python, C++, …) are meant for reading/writing directly from/to the cdb.
If you want to run an analysis you can call sps.exe from the command line. It’s the batch equivalent of wps.exe (the calculation window).
The syntax is found in the general sofistik help, basically:
“sps.exe myfile.dat”
In python you would use subprocess.run([“sps.exe”,“myfile.dat”]) or something similar.
Thank you i will try that.
Hi @MTsegaye
Did you had any success?
I want to run a teddy file directly from the python interface without opening SOFiSTiK and then read the results
yes it is possible to calculate with python, but you dont get good feedbacks of errors and warnings. You can use the following code.
#####################
import subprocess
subprocess.run([‘C:/Program Files/SOFiSTiK/2023/SOFiSTiK 2023/sps.exe’,filepath]) # replace the path to your sofistik sps.exe file and the path to your teddy file → filepath accordingly
############
it is also possible to read from cdb. Refer to the following link
Read the node properties — CDB Interfaces 2022 (sofistik.com)