Can I import rhino viewport in grasshopper?

I created my custom view, changing some property settings in rhino such as basic sky color and named it custom_view. (not named view)
Instead of setting it as current viewport in rhino, is there any way to import named custom viewport in grasshopper? I checked some rhinocommon library but I could only find the way how to import current rhino viewport.
doc.Views.ActiveView.CaptureToBitmap() method allows me to use the current one, but couldn’t figure out importing other views…

Do you mean import it as an image to post-process in Grasshopper?

yes, I want to use the image as an input for the next step. :slight_smile:

I don’t think that this can be done straight out of the box, but it surely can be scripted in Python or C#. There might even be a plug-in that does this, but I have no idea which one.

What I imagine you’d want to do is, do a viewport capture to file, and simply return the path to the locally saved image, or read some pixel data and output that?

Right, I am thinking scripted way but couldn’t find right way.
view capture to file could be an option but not sure not current view could be possible to do that. :frowning:

Here’s an example:
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Display_RhinoView_CaptureToBitmap_3.htm

Yes, I already checked it. As I mentioned the post, It seems it is only possible for current view.

Here’s how to get the non-active views in Python:

active_view_name = doc.Views.ActiveView.ActiveViewport.Name
non_active_views = [(view.ActiveViewport.Name, view) for view in doc.Views if view.ActiveViewport.Name <> active_view_name]

Thanks for searching it. :slight_smile:
active one works but don’t know why non_active_views doesn’t work…

You need to use view, not view.ActiveViewport.Name for capturing if I remember correctly, but it’s hard to tell what you even do.

For example, I create custom view setting to change sky color to black and name the view setting sky_black. but without making it current active viewport in rhino, I just want to save or export sky_black view image file in some way.