export_diagram
Export L1, L2, or L3 network diagrams from a master file. Choose SVG for browser viewing or PPTX for editing, and optionally restrict to a specific area.
Instructions
Export an L1, L2, or L3 network diagram for the given .nsm master.
PREREQUISITE: You MUST have called get_ai_context(master) (or at least
get_network_state(master)) at least once in this session for this
master so that you understand which layer is meaningful to export
given the current network state.
Args:
master: Master filename inside the working directory.
layer: One of 'l1', 'l2', 'l3' (case-insensitive).
format: 'svg' (default) or 'pptx'. SVG is faster and renders in the
browser. PPTX is editable in PowerPoint.
area: Optional area name. When omitted, every layer now emits a
combined All-Areas diagram so that L1/L2/L3 share a
uniform default contract:
- L1: all_areas_tag
(file: '[L1_DIAGRAM]AllAreasTag_<basename>.svg' or .pptx).
- L2: all_areas
(file: '[L2_DIAGRAM]AllAreas_<basename>.svg').
NOTE: PPTX output for L2 area=None is not yet supported
by the engine ('--type all_areas requires --format svg'),
so the legacy first-area PPTX behaviour is preserved
when format='pptx' (file:
'[L2_DIAGRAM]<first_area>_<basename>.pptx').
- L3: all_areas
(file: '[L3_DIAGRAM]AllAreas_<basename>.svg' or .pptx).
When given:
- L1 generates only that area's per-area-tag SVG
(file: '[L1_DIAGRAM]PerAreaTag_<basename>_<area>.svg').
- L3 generates only that area's per-area SVG
(file: '[L3_DIAGRAM]PerArea_<basename>_<area>.svg').
- L2 generates that area's diagram
(file: '[L2_DIAGRAM]<area>_<basename>.svg' or .pptx).
area is only honored together with format='svg' for L1/L3
(the engine's PPTX path always produces an all-areas pptx);
L2 accepts area for both formats. Unknown area names are
rejected by the engine with a clear error.
Returns:
A summary describing which files were generated, plus the engine
stdout. Use get_workspace_info afterwards to enumerate the files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| area | No | ||
| layer | Yes | ||
| format | No | svg | |
| master | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |