Appearance
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 one exception is views.capture, which throws if you pass a viewId (per-view capture is not supported yet; capture the current viewport instead). 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)
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)
At a glance
| Method | What it does | Mutates? |
|---|---|---|
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 | ✓ |
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) |
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.
| Member | Needs Present mode open? |
|---|---|
views.* | No — works from the Design context |
sheets.list / sheets.get | Reads return [] / null when Present mode is closed |
sheets.create / sheets.place | Yes — 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.place | Yes — throws when Present mode is not open |
slideshow.start / stop | Yes — throws when Present mode is not open; getState reports not-running instead |
import.image / import.pdf | Yes — 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 |
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}`);