Grasshopper

algorithmic modeling for Rhino

I made this sometime ago for capturing screenshots to files automatically. Aim to save some time, and to fully utilize the possibility of parametric routine: Change parameters and see what happens. It works joyfully if you want to change parameters and generate screen captures and planning to do a lot of them. You can of course generate the file name dynamically referring to the parameters you gave to the script, so that you have meaningful file names.

The example below will generate two captures at J:\Temp\001_top,jpg and J:\Temp\001_front,jpg both at 600X600 px in ghosted mode.

 

 

 

The instructions are as follows: (if you open the VB code by double clicking you will see it)

' Note1: The script is actually calling Rhino commands.   

' Note2: Remember you have to draw something and is selectable for the script to function. The script uses _SelAll then _Zoom _Selected   

' Note3: After you toggle blnSave to True, a new viewport will popup, be patient while Rhino work, and wait for that viewport to disappear befor clicking on anything.   

' Note4: The component is not stable if you try to mouse click on anywhere while the saving process is running. Some stupid move may crash your programme, save RH and GH files before using this component.

' FileName :  String Input    = Supply with the path and file name without ".jpg" extension : e.g.: "C:\Temp\001" (Without the quotes)   

' blnSave :   Boolean Input   = Saves when toggles to True (Remember to toggle back to False after use, otherwise the script will re-run itself during next update)   

' Resolution_width :    Integer Input = Resolution for the captured image   

' Resolution_height :   Integer Input = well...   

' TopYea :    Boolean Input =   Toggles if the Top View is captured (Default is False if not connected)   

' FrontYea :  Boolean Input =   Toggles if the Front View is captured (Default is False if not connected)   

' ...Yea :    Boolean Input =   Toggles if the corresponding View is captured (Default is False if not connected)   

' DisplayMode : Integer Input(0-4) = Sets the display Mode 0:Shaded 1:Wireframe 2:Rendered 3:Ghosted 4:XRay Default:Shaded

 

 

I remember I took some code from somewhere but I forgot exactly the source, (if someone could remind me I would love to cite) I rewrite most of them though. But the attribution header in the code still remains there and now it seems a bit interesting to see the family tree:

 

'////// Marc Hoppermann ///////////tweaked by Damien Almor ///////rewritten for curves by to]///////adapted by u]...www.utos.blogspot.com ///readapted by Victor Leung @ www.dreamationworks.com

 

Visit my blog if you have time: www.dreamationworks.com

Views: 5651

Attachments:

Replies to This Discussion

Hi Victor,

thanks for this. This is great! 

I wonder if you've made any modifications over the years? I'd like to use a custom display mode (i.e. a higher number, like 10). Also is there a way to select the active viewport because the standard screenshot doesn't necessarily zoom in nicely on the subject.

Thanks again!

Greg

Hi Greg,

Great that you liked it. I have not made any changes after I wrote this script. Perhaps you can update it and upload a newer version here.

Cheers

Victor

victor. very cool component/. i tried to get this to work without coding with native components (since im not yet there)

it works but i cant find the actual saved jpgs

thnx

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service