Running OpenSees files from Notepad++

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
staniser
Posts: 6
Joined: Mon Sep 06, 2010 6:34 am
Location: Middle East Technical University

Running OpenSees files from Notepad++

Post by staniser »

Is there any way to run OpenSees files (files with .tcl extension) from Notepad++? I am modifying .tcl files in Notepad++ but when running I have to open them with TclEditor.
etahmasebi
Posts: 11
Joined: Tue Sep 14, 2010 7:16 pm
Location: Lehigh University

Re: Running OpenSees files from Notepad++

Post by etahmasebi »

You can use a batch file to run your model. When using the tclEditor, it also creates a batch file named exec.bat in the same location the model is. If you double click on it it will run your model. Make sure that the addresses in the batch file are referring to the correct locations and then you can assign this batch file in notepad++ as the executable file.
CH101
Posts: 2
Joined: Tue Jun 19, 2012 9:34 am
Location: Santa Cruz

Re: Running OpenSees files from Notepad++

Post by CH101 »

Great question, staniser. Etahmasebi, good to know Notpad++ can be used long as the addresses in the batch file are referring to the correct locations. Thanks for explaining.
staniser
Posts: 6
Joined: Mon Sep 06, 2010 6:34 am
Location: Middle East Technical University

Re: Running OpenSees files from Notepad++

Post by staniser »

Thank you very much etahmasebi for your explanation.
civilas
Posts: 4
Joined: Thu Sep 06, 2012 10:14 pm
Location: University of Canterbury

Re: Running OpenSees files from Notepad++

Post by civilas »

Dear All,
I have used from opensees in my MSc four years ago, and now I have just started my PhD. I want to use Opensees but I see it has changed specially about running that.
In last version when I decided to run I can push the run key in Tcl editor. But, now when I downloaded tcl/tk 8.5.12 from the site and open it, I see that it opens in Notepad++, and if I want to run it, I have to save it and then ope opensees and type source ...tcl. this process is time consuming. Please let me know any way to solve it.
Thank you
etahmasebi
Posts: 11
Joined: Tue Sep 14, 2010 7:16 pm
Location: Lehigh University

Re: Running OpenSees files from Notepad++

Post by etahmasebi »

You can create a batch file if you want to run your model several times. In order to create a batch file, create a txt file with ".bat" extension and copy this in it:

echo off
cls
echo Starting OpenSees..
echo off
location_of_OpenSEES\openSees.exe location_of_your_model\yourModel.tcl

and then save the file and close it. Then you can double click on this file and it will run your model. Make sure to use the correct addresses for your model and OpenSEES executable files.
civilas
Posts: 4
Joined: Thu Sep 06, 2012 10:14 pm
Location: University of Canterbury

Re: Running OpenSees files from Notepad++

Post by civilas »

Thank you for your reply, It works. But the name of the file should be *.bat.
Cheers,
Panos
Posts: 23
Joined: Fri Jul 20, 2012 10:28 am
Location: National Technical University of Athens

Re: Running OpenSees files from Notepad++

Post by Panos »

Does anyone know, how can I modify the script etahmasebi posted, so that the opensees window doesn't close immediately after the calculations are completed? (and monitor the execution of the programm, any error messages etc)
cxc08
Posts: 23
Joined: Fri Mar 02, 2012 5:51 pm
Location: Tokyo

Re: Running OpenSees files from Notepad++

Post by cxc08 »

I have the same question with Panos. Does anyone know any solutions?
Panos
Posts: 23
Joined: Fri Jul 20, 2012 10:28 am
Location: National Technical University of Athens

Re: Running OpenSees files from Notepad++

Post by Panos »

Sorry, I found the answer elsewhere and forgot to update the topic. Add the command "pause" in a new line in the end:
echo off
cls
echo Starting OpenSees..
echo off
location_of_OpenSEES\openSees.exe location_of_your_model\yourModel.tcl
pause
skygrandpa
Posts: 6
Joined: Mon Mar 07, 2016 7:23 am
Location: Beijing University of Civil Engineering and Architechture

Re: Running OpenSees files from Notepad++

Post by skygrandpa »

1. create a batch file run_opensees.bat :
echo off
cls
echo Starting OpenSees..
cd %1%
opensees %2%
opensees
break

2. Put the run_opensees.bat created above and the OpenSees.exe into a same folder. (I choose C:\Program Files\OpenSees\bin\)

3.Add that folder to the system variable PATH .

4.Press F5 in Notepad++ and input
run_opensees "$(CURRENT_DIRECTORY)" "$(FILE_NAME)"

save this as a shortcut and setting a shortcut key

5.Run this shortcut when you edit the *.tcl file! :D :D :D :D
Post Reply