Skip to content

Presentation ​

Prepare and assemble presentations: save and capture camera views, lay them out on sheets, place diagram images, and import reference assets. Reads describe the artifacts a presentation is built from (saved views, layout sheets); writes assemble them. Accessed via snaptrude.presentation.

All methods are host API calls that return Promises. Reads never throw for a missing artifact (get/getActive return null, list returns []) — the exceptions are views.capture, which throws if you pass a viewId (per-view capture is not supported yet; capture the current viewport instead), and camera.*, which throws when Present mode is not open. Several members require Present mode to be open (the documentation editor) — see the precondition table below; outside Present mode those writes throw and sheet reads return empty.

Sub-namespaces ​

Views ​

Saved 2D/3D views — camera bookmarks, not geometry. List and read them, capture them to base64 images, activate one (move the camera to it), and save the current camera as a new view. Works from the Design context; Present mode is not required. (snaptrude.presentation.views)

Camera ​

The Present canvas camera — screenshot what is on screen, read pan/zoom, pan and zoom it, frame every sheet or one shape. View-state only. (snaptrude.presentation.camera)

Sheets ​

Layout sheets — the pages in Present mode that views and diagrams are placed onto. List/get sheets, create new ones, and place a saved view onto a sheet as a canvas shape. (snaptrude.presentation.sheets)

Placed views ​

Views already placed on the Present canvas — read and edit their layout: move them (within or across sheets), resize them, set a standard architectural scale, and crop. Content refresh stays on sheets.updatePlacedView. (snaptrude.presentation.placedViews)

Diagrams ​

Diagram placement — drop ready diagram images onto a sheet by URL. Adjacency data itself is read and computed via snaptrude.program.adjacency. (snaptrude.presentation.diagrams)

Import ​

Reference assets — bring an external image or PDF (each PDF page vectorized to SVG) onto the current Present sheet from a url or dataUrl. (snaptrude.presentation.import)

Annotate ​

Annotations on Present-mode sheets — the scriptable counterparts to the Present toolbar's annotation tools: text labels, arrows, sticky notes, and geo shapes, each nested under the sheet frame. (snaptrude.presentation.annotate)

Shapes ​

Plugin-owned keyed shapes on Present-mode sheets — upsert one stable shape per caller-chosen key, so rerunning an analysis updates the sheet in place instead of duplicating. (snaptrude.presentation.shapes)

Tables ​

Data tables on Present-mode sheets — place plain string rows as a table shape, the same shape the Present canvas creates when a spreadsheet table is pasted. (snaptrude.presentation.tables)

Slideshow ​

The Present-mode slideshow — start/stop it programmatically and read its state. Plays all layout sheets in order; may run non-fullscreen (fullscreen needs a user gesture). (snaptrude.presentation.slideshow)

Export ​

Render the Present-mode layout sheets to a downloadable file — PDF, PNG, or JPG — and receive the encoded bytes as base64. (snaptrude.presentation.export)

AI Inspiration ​

Present-mode AI image/video generation — list models and presets, generate/refine from Present canvas sources (blocking or as trackable jobs), inspect workflow lineage, and manage reusable project recipes. (snaptrude.presentation.aiInspiration)

Walkthroughs ​

Camera paths through the model — create them from keyframes, floor points or camera-move presets (orbit, fly over, push in, pull back, rise), check them for clashes, capture frames, play them in the viewport, and export them as a video onto the Present canvas as a job. Not saved with the project yet. (snaptrude.presentation.walkthroughs)

Sections ​

Section lines on the plan — create, edit and delete them, open or close a section view, and read what a section cuts (getCut): every element its plane passes through, with cut area, outline length and extent, computed from the model without opening the view. (snaptrude.presentation.sections)

At a glance ​

MethodWhat it doesMutates?
views — saved 2D/3D views
views.list()List the saved 2D/3D views—
views.get(viewId)Read one view by id—
views.getActive()Get the currently active view—
views.capture(options?)Screenshot the current viewport as base64—
views.setActive(viewId)Move the camera to a saved view✓
views.create(name?, options?)Save the current camera as a new named view✓
camera — the Present canvas camera (Present mode)
camera.capture(options?)Screenshot the visible Present canvas as base64—
camera.get()Read pan, zoom, visible rect and the sheet on screen—
camera.set(camera)Pan and/or zoom the Present canvasview
camera.zoomToFit()Frame everything on the canvasview
camera.zoomTo(shapeId)Frame one sheet or shapeview
sheets — layout sheets (Present mode)
sheets.list()List the layout sheets—
sheets.get(sheetId)Read one sheet by id—
sheets.create(name?)Add a new layout sheet✓
sheets.place(sheetId, viewId, options?)Drop a saved view onto a sheet✓
placedViews — layout of placed views (Present mode)
placedViews.list(sheetId?)List the placed views (optionally one sheet's)—
placedViews.get(shapeId)Read one placed view by shape id—
placedViews.move(shapeId, position, options?)Reposition a placed view (optionally to another sheet)✓
placedViews.scale(shapeId, factor)Uniformly resize a placed view✓
placedViews.setScale(shapeId, scale)Set a standard architectural scale (2D only)✓
placedViews.setCrop(shapeId, crop)Crop a placed view, or clear the crop✓
diagrams — diagram generation + placement
diagrams.generateProgram()Auto-generate space + department diagram sheets✓
diagrams.generateSite(options?)Generate location / streetview / climate diagram sheets✓
diagrams.place(sheetId, urls, options?)Drop diagram images (by URL) onto a sheet✓
tables — data tables (Present mode)
tables.place(sheetId, table, options?)Place string rows as a table shape on a sheet✓
slideshow — the Present-mode slideshow
slideshow.start(options?)Launch the slideshow over all sheets✓
slideshow.stop()Close the running slideshow✓
slideshow.getState()Whether it is running + the current slide index—
import — reference assets (Present mode)
import.image(source, options?)Place a reference image on the current sheet✓
import.pdf(source, options?)Place a PDF on the current sheet, one SVG shape per page✓
aiInspiration — Present-mode AI generation — see AI Inspiration for the full 18-method surface (models, sources, generate/refine, jobs, workflow lineage, recipes)
walkthroughs — camera paths — see Walkthroughs for the full 21-method surface (create, keyframes, sample, issues, capture, playback, export jobs)
sections — section lines — see Sections for the full 8-method surface (create, update, delete, open a view, getCut)

Present mode preconditions ​

Present mode required for assembly

Sheet writes, diagram placement, and imports operate on the Present canvas and throw when Present mode is not open. Sheet reads do not throw — they return []/null instead. Views are camera bookmarks on the design scene and work without Present mode.

MemberNeeds Present mode open?
views.*No — works from the Design context
camera.*Yes — every method throws when Present mode is not open
sheets.list / sheets.getReads return [] / null when Present mode is closed
sheets.create / sheets.placeYes — throws when Present mode is not open
placedViews.*list returns [] when Present mode is closed; get and every write throw
diagrams.*Yes — throws when Present mode is not open (generators and place)
tables.placeYes — throws when Present mode is not open
slideshow.start / stopYes — throws when Present mode is not open; getState reports not-running instead
import.image / import.pdfYes — throws when Present mode is not open
aiInspiration.*Canvas-facing calls (sources, selection, generate/refine, workflow, recipes) throw when Present mode is not open; model/preset/job reads work anywhere
walkthroughs.*No — walkthroughs live in the design scene; export opens Present mode itself to place the video
sections.*No — sections live in the design scene; setActive opens the section view there

Worked example: from camera to sheet ​

Save the current camera as a view, create a sheet, and place the view on it. The view can be saved from the Design context; Present mode must be open for the sheet steps.

ts
// Design context: bookmark the current camera as a named view
const view = await snaptrude.presentation.views.create("Hero Perspective");

// Present mode must be open from here on
const sheet = await snaptrude.presentation.sheets.create("Cover");
const { shapeId } = await snaptrude.presentation.sheets.place(sheet.id, view.id);
console.log(`Placed "${view.name}" on "${sheet.name}" as shape ${shapeId}`);