Automatic grouping of animation cells
- To: mathgroup at smc.vnet.net
- Subject: [mg19075] Automatic grouping of animation cells
- From: adam.smith at hillsdale.edu
- Date: Thu, 5 Aug 1999 01:34:59 -0400
- Organization: Deja.com - Share what you know. Learn what you don't.
- Sender: owner-wri-mathgroup at wolfram.com
Awhile back someone wanted asked how to automatically close a large number of graphics cells produced for animations. P.J. Hinton replied with the following (cut from the archives): >> Is there a way to automatically close the group of cells for a 100+ >frame >> animation? >When is the group of cells to be closed? >Are you generating a large number of graphics and then attempting to >close the group of cells after the graphics are generated through some >programmatic matter? >If so, you could do something like this little code snippet. > >Do[Plot[Sin[2 Pi f t], {t,0,1}],{f,1,5}]; >SelectionMove[EvaluationNotebook[], After, EvaluationCell]; >SelectionMove[EvaluationNotebook[], Next, CellGroup]; >FrontEndTokenExecute["OpenCloseGroup"] Well, this works in closing all the cells and leaving only the input visible. But what I wanted to do was to group the graphics output and then collapse it, thus showing only the first frame. Thanks to the above I started playing around and came up with what I hope is a useful solution to others: Do[Plot[Sin[2 Pi f t], {t,0,1}],{f,1,5}]; SelectionMove[EvaluationNotebook[], All,GeneratedCell]; FrontEndTokenExecute["CellGroup"] FrontEndTokenExecute["OpenCloseGroup"] It worked really well when I had a complicated Graphics[ ] expression. Adam Smith Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.