All docs
Context·
property
Context.viewer
the 3d/2d viewer surface, if a viewer is open
Python
viewer: Viewer
Returns Viewer — the viewer surface, or None
Example#
Python
@tool.command("demo/frame")
def frame(ctx: Context):
if ctx.viewer:
ctx.viewer.fit()
Notes#
A lazily populated slot — None when no viewer is available. Use it to drive the camera, layers, and
drawing on the open viewer.
See also#
Guides: Commands & actions
By LSD Team · Last updated Jul 17, 2026
Ask on Discord
View as Markdown