Blocks
Request block snapshots and update CAD block visibility from the host.
Block workflows expose repeated CAD entities that can be filtered independently from layers.
Use blocks when your product needs a host-side panel for named symbols, reusable CAD objects, or selective visibility controls based on block naming.
- Request current block state with `getBlocks`.
- Listen for `blocksSnapshot` and render the returned collection.
- Send `setBlockVisibility` using `all`, `index`, `indexes`, `name`, or `names`.
The block flow mirrors the layer flow, but the payload targets block names and indexes.
Request blocks
Listen for blocksSnapshot
Hide multiple blocks
Show all blocks
The host requests the current block collection, renders it in its own UI, and sends visibility updates back into the viewer.
1. Host requests blocks
Call `getBlocks` when the CAD block panel opens or the active file changes.
2. Viewer returns blocksSnapshot
The viewer responds with the current block list and visibility state for the active document.
3. Host posts visibility updates
Use block names or indexes from the snapshot when toggling host-side controls.
This pattern gives you a standalone block panel without coupling it to layer rendering.
Use the related pages below when you need the matching layer workflow or the full payload reference.
- Layers: Layers
- Technical Reference: API References
- CAD Overview: Overview
