Skip to content

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.

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:

PageChangesLicensed
DescribeNothing — read-onlyno
Set camera · Display mode · Zoom extentsThe viewport onlyno
Named viewsRestoring is view-only, but saving and importing write the document’s named-view tablesaving and importing
CaptureWrites an image file to diskyes