I’ve been building a plugin that uses the captureToBitmap() method. I got the plugin working on Windows and then moved it over to Mac. I made sure to make a new .csproj file that uses the RhinoCommon.dll for mac, however, code blocks such as this one no longer seem to work:
b.Save(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + "/test_out.jpg");```
The method returns null even though the viewport appears valid (I checked the local variables in my debugger). Any thoughts on way this would happen?
Thank you for replying. I am not familiar with Rhinoscript at all, so I’m wondering if this command will result in a direct output to a file, or if dialogs and/or options are involved. If the latter is the case, it is unusable for me, because I am interested in batch-processing viewport images.
I see that the bug item is newly opened; is there an expected milestone where this bug will be considered?
I have tried the script you shared, which works as expected. However, there is one issue, which is that Grasshopper geometry is not visible in the exported image. That being said, the geometry is visible if I manually use the ViewExportToFile command through the Rhino interface.
Is there any way to include GH geometry using the Rhinoscript version of ViewCaptureToFile as well? Am I missing some parameter perhaps?
I am trying to batch export images of multiple design alternatives using Rhino and GH.
This is a bit confusing because the sample code is just running the ViewCaptureToFile. And if I just run the above code in a non-batch way the output contains Grasshopper stuff.
How are you batching all this? Perhaps you script needs a "redraw’ or a “wait” to give Grasshopper a chance to paint…