Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

After manipulating the graphics in a dynamic module like this:

Synchronizing manual rotations for multiple Graphics3D outputs?

How do I get at the current graphic so that I can Export the image?

The answer might be burried in here Using DynamicModule variables outside the DynamicModule someplace but i am unable to decipher it..

share|improve this question
1  
If don't need something automated, right click and copy graphic and then paste into Export["filename.png",<paste here>] –  bobthechemist Jun 6 '13 at 16:39
    
Thanks, that does indeed work -- not a terribly satisfying approach though. –  george2079 Jun 6 '13 at 16:50
    
With a GraphcsRow/Grid you need to copy/paste the whole cell.. –  george2079 Jun 6 '13 at 16:53
1  
I agree - were I more imaginative, I would have posted an answer instead of a comment :-) –  bobthechemist Jun 6 '13 at 16:58

3 Answers 3

up vote 8 down vote accepted

You need to identify the graphics object with a (local, dynamic) variable to use in a call to Export[]. It's easy to use a button to export from within the scope of the dynamic block. If you want the button to be external to the block, you can use TaggingRules as explained in your link. I prefer not to play around with extending the scope of variables.

SetDirectory[NotebookDirectory[]];
DynamicModule[{vp = {2, -2, 1}, vv = {0, 0, 1}, g},
 Grid[{{
    g = GraphicsRow[{Graphics3D[{Cone[{{0, 0, 0}, {2, 3, 4}}, 3]}, 
        SphericalRegion -> True, ViewPoint -> Dynamic[vp], 
        ViewVertical -> Dynamic[vv]], 
       Graphics3D[{Cone[{{1, 0, 1}, {1, 1, 1}}, 4]}, 
        SphericalRegion -> True, ViewPoint -> Dynamic[vp], 
        ViewVertical -> Dynamic[vv]], 
       Graphics3D[{Cone[{{1, 1, 1}, {9, 9, 9}}, 4]}, 
        SphericalRegion -> True, ViewPoint -> Dynamic[vp], 
        ViewVertical -> Dynamic[vv]]}]},  
   {Button["Save Figure", Export["dynamicfigure.png", g]]}}]]

With a button!

share|improve this answer
    
pretty slick!! 15 characters –  george2079 Jun 6 '13 at 17:43
    
You can also use an InputField[] with a dynamic string variable to define a file name, if you like. –  Corey Kelly Jun 6 '13 at 18:15

A useful alternative based on Corey Kelly's answer, make the button "save" the dynamic varibles:

Button["save data", {savevp, savevv} = {vp, vv}; ]

Then outside the dynamic module these are available to make a 'statiic' graphic by repeating the graphic directive using ViewPoint -> savevp , etc.

Here I've "saved" a number of manipulated views, then combined into a single image for Export[].

enter image description here

share|improve this answer

You can simply use Save Selection As... (png for example) option in Menu. Using example of Corey Kelly:

enter image description here enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.