Grasshopper

algorithmic modeling for Rhino

Hi all,

Literally my first attempt at using rs/python in GH

I want to call the rhino command ViewCaptureToFile

here's my script, it seems to work, it just wont actually make the image file.

import rhinoscriptsyntax as rs


if go:
rs.Command('-ViewCaptureToFile "E:/Users/Oliver Bucklin/Desktop/IDP3vid/test'+frame+'.png" Enter _Width 1920 _Height 1080 _Enter')

Thanks!!

Views: 696

Replies to This Discussion

Great Python resource. I only found Rhinoscript source before. Do you have any other favorites that directly relate to Rhino Python use? Your Kangaroo 2 custom goal translations to Python are already on my study list.

Attached my latest version (which uses RhinoCommon directly). The function you want in the script is captureActiveViewToFile(). I agree that it is unfortunate that this information is spread out and hard to come by. At some point (once I'm done with with my PhD) I plan to make a GitHub repo with all the GHPython tips/tricks, snippets etc. I've discovered/developed over the years. Hopefully :)

Attachments:

rs.Command('-ViewCaptureToFile C:\\test.png w 1920 h 1080 Enter')

The double backslash results in one real backslash.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service