MoI discussion forum
MoI discussion forum

Full Version: Grid showing with snap shot

Show messages: All  1-8  9-12

From: Michael Gibson
6 Aug   [#9] In reply to [#8]
Hi Tim, for using the script in Mip's message above, go to Options > Shortcut keys and push the "Add" button and then press what key combination you want to trigger it. Then paste in the script code for the "Command" value of the shortcut key.

- Michael
From: Tim (TIMM)
26 Oct   [#10] In reply to [#4]
Hi Mip
Thanks for this, worked a treat.
T
From: Tim (TIMM)
26 Oct   [#11] In reply to [#9]
Hi Michael,
Thanks for this, managed to paste in script and use OK. One thing though, my screen put the grid on after using the script, had to go into Options to remove the grid. I was using short cut key as Mip had used Ctrl, Alt, S. Any idea why grid appeared back on screen?
thanks
Tim
From: Michael Gibson
26 Oct   [#12] In reply to [#11]
Hi Tim,

re:
> Any idea why grid appeared back on screen?

It's just what the script does - it turns off the grid, takes the snapshot, then turns on the grid.

Try this variation which will save the current grid display state and restore it instead of just turning it off and on:


script: /* Generate viewport image white background 4000, 2500 linewidth : 4 */ var prev_background = moi.view.viewportBackgroundColor; moi.view.viewportBackgroundColor = 0xFFFFFF; var prev_linewidth = moi.view.lineWidth; moi.view.lineWidth = 4; var prev_griddisplay = moi.grid.display; moi.grid.display = false; var prev_showxyaxes = moi.grid.showXYAxes; moi.grid.showXYAxes = false; var prev_showaxisicon = moi.view.showAxisIcon; moi.view.showAxisIcon = false; var prev_showviewtitles = moi.view.showViewTitles; moi.view.showViewTitles = false; var img = null; try { img = moi.ui.getActiveViewport().render( 4000, 2500 ); } catch(e){} moi.view.lineWidth = prev_linewidth; moi.grid.display = prev_griddisplay; moi.grid.showXYAxes = prev_showxyaxes; moi.view.showAxisIcon = prev_showaxisicon; moi.view.showViewTitles = prev_showviewtitles; moi.view.viewportBackgroundColor = prev_background; var name = img.getSaveFileName(); if ( name != '' ) img.save( name );


- Michael

Show messages: All  1-8  9-12