Scripting API
Views
from ArtisanPlugin.Scripting import ViewApi as view
The viewport side of the API: aim the camera, restore a saved angle, switch the display mode and capture a frame. Mostly this is what you drive before a screenshot. Each has its own page.
DescribeThe viewports, named views and display modes available.
Set cameraPlace the camera: location, target and lens.
Named viewsRestore, save, and import the standard angles.
Display modeWireframe, Shaded, Rendered, Raytraced, Arctic…
Zoom extentsFrame the visible geometry.
CaptureThe viewport frame to PNG, at any resolution.
The viewport argument
Every method here takes a viewport argument defaulting to None, meaning Rhino’s active view. Pass a name to target a specific one — Describe tells you which names exist. Matching is case-insensitive and trimmed, and covers standard model viewports only: layout and page viewports are excluded and cannot be addressed. An unknown name throws, listing the real ones.
Views are mostly not the document
With two exceptions these change what you see, not what the document contains, so they need no Transaction:
| Page | Changes | Licensed |
|---|---|---|
| Describe | Nothing — read-only | no |
| Set camera · Display mode · Zoom extents | The viewport only | no |
| Named views | Restoring is view-only, but saving and importing write the document’s named-view table | saving and importing |
| Capture | Writes an image file to disk | yes |