I have searched the Web, the Help files, and everywhere in between. I cannot find a way to kill graphs from the command line. It's easy to kill waves, but what about graphs, or even tables? Is there a way to kill these objects from the command line?
I have searched the Web, the Help files, and everywhere in between. I cannot find a way to kill graphs from the command line. It's easy to kill waves, but what about graphs, or even tables? Is there a way to kill these objects from the command line?
Look under DoWindow/K or KillWindow.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
Dr. Weimer, thanks a lot, you are always a huge help. Sorry I couldn't figure this out on my own, but the manual is just so thick...
Here is the preliminary solution I came up with. Basically, this macro relies on the default graph name being "Graph#". It will give an error if "endnum" exceeds the actual number of graphs, or if there is a non-sequential ordering of the graphs (e.g. graphs 1-3 exist, and 5-7, but not graph4. The function will fail on graph4). I am all ears if someone would like to point out some good ways to avoid error codes, but for now, this helps me quite a bit. I often times generate 10-20 graphs just to look at them once, and then kill them, no need to bring them up later.
Here's yet another possibility. It kills all graphs and windows.
function kill_graphs_and_tables()string object_name
variable string_length
do
object_name = WinName(0,3)// name of top graph or table (see III-441)
string_length = strlen(object_name)// returns "" if no graph/table is present if(string_length == 0)breakendifDoWindow/K $object_name// kill top graph or table; keep going till all donewhile(1)// loop forever until break end
John Bechhoefer
Department of Physics
Simon Fraser University
Burnaby, BC, Canada
I have searched the Web, the Help files, and everywhere in between. I cannot find a way to kill graphs from the command line. It's easy to kill waves, but what about graphs, or even tables? Is there a way to kill these objects from the command line?
Or this, to kill any of graphs, tables, layouts, notebooks, panels, XOP windows:
Is there a simple way to kill the most recently opened window without knowing it's name?
No, but you can kill the top graph:
Function KillTopVisibleGraph()String topGraph = WinName(0, 1, 1)if(strlen(topGraph) == 0)return0endifDoWindow/K $topGraphreturn1End
If you really want to kill the most-recently-created graph, you would have to keep track of the time of creation. This could be stored as user data in the graph but it is much more complicated than killing the top graph.
Look under DoWindow/K or KillWindow.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
October 30, 2008 at 12:14 pm - Permalink
Here is the preliminary solution I came up with. Basically, this macro relies on the default graph name being "Graph#". It will give an error if "endnum" exceeds the actual number of graphs, or if there is a non-sequential ordering of the graphs (e.g. graphs 1-3 exist, and 5-7, but not graph4. The function will fail on graph4). I am all ears if someone would like to point out some good ways to avoid error codes, but for now, this helps me quite a bit. I often times generate 10-20 graphs just to look at them once, and then kill them, no need to bring them up later.
-Mike
October 31, 2008 at 11:40 am - Permalink
Try the following:
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
October 31, 2008 at 03:23 pm - Permalink
I removed the $ before WindowName in the call to WinType().
October 31, 2008 at 05:53 pm - Permalink
John Bechhoefer
Department of Physics
Simon Fraser University
Burnaby, BC, Canada
November 1, 2008 at 12:32 pm - Permalink
Or this, to kill any of graphs, tables, layouts, notebooks, panels, XOP windows:
Regards,
Patrick.
November 2, 2008 at 03:58 pm - Permalink
Is there a simple way to kill the most recently opened window without knowing it's name?
Thanks
February 16, 2011 at 11:18 am - Permalink
No, but you can kill the top graph:
If you really want to kill the most-recently-created graph, you would have to keep track of the time of creation. This could be stored as user data in the graph but it is much more complicated than killing the top graph.
February 16, 2011 at 01:07 pm - Permalink