My issue:
I’m using the _ViewCaptureToFile command very often for several Named Views. For example: I have 8 Named views and i want to save each named view to a jpg, the change material and/or geometry and do again 8 jpgs one per named view each. so far i only managed to do it one by one.
Question:
Is there a possibility to apply _ViewCaptureToFile to a list of Named Views (preferably with a tick-box for each view). Would it work as a macro (never used so far), or would be possible to program such a command (for someone who never programmed a rhino command but would be interested to give it a try)?
Thanks a lot for your support
PS. I was using it a lot in Rhino Mac 6 WIP with the use of textures and ambient occlusion - i really like this feature! Thanks a lot!
yes you can hard code it or prompt for a path
hard coded below
EDIT : or uncomment the BrowseForFolder line to prompt the location
There is more room for customisation, eg selecting the different screen capture options, …
import rhinoscriptsyntax as rs
import os
all_views = rs.NamedViews() # a list of names (strings)
selected_views= rs.MultiListBox(all_views, message = "select views to save", defaults = all_views)
filename_base = rs.GetString("base file name","Rics_file_")
savepath = r"C:\Users\KNAPP\Documents\KNAPP"
# savepath = rs.BrowseForFolder(rs.DocumentPath(), "destination directory")
filepath = os.path.join(savepath, filename_base)
for view_name in selected_views:
rs.RestoreNamedView(view_name)
rs.Command('-_ViewCaptureToFile '+chr(34)+filepath+view_name+'.jpg'+chr(34)+' _EnterEnd')
Hey, is there a way to set export resolution beyond the current view port size?
ie -
rs.Command(‘-_ViewCaptureToFile ‘+chr(34)+filepath+view_name+’.png’+chr(34)+“_Width 4000 _Height 2250 _EnterEnd”)