Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

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.


  • Prev by Date: Re: Lists to mask other lists
  • Next by Date: Re: equaltity of lists
  • Previous by thread: HELP: Mathlink and InterpolatingFunction
  • Next by thread: Re: Automatic grouping of animation cells