Render layer-filtered SVGs
render_svg turns a DXF layout into an SVG file, filtered to layers matching a pattern. It’s the fastest way to see what a layer inventory or parcel extraction is talking about.
Basic call
Section titled “Basic call”{ "tool": "render_svg", "operation": { "file_path": "/data/site-plan.dxf", "operation": "render", "parameters": { "layer_pattern": "C-PROP*", "output_name": "property-lines", "layout": "Model" } }}The file is written to the server’s output directory as property-lines.svg, and the response reports the path, file size, entity count, and SVG element count. output_name must be a bare filename stem — path separators are rejected.
layout accepts "Model" (default) or any paperspace sheet name from list_sheets, so you can render a specific deliverable sheet.
The frozen-layer gotcha
Section titled “The frozen-layer gotcha”Here’s the trap that motivates this page: DXF renderers normally skip entities on frozen or off layers, faithfully reproducing what a plotter would show. On real civil files, that hides exactly the layers worth looking at — no-plot boundary layers (*-NPLT suffixes) are routinely frozen precisely because they’re working linework, not deliverable graphics.
mcdrafter takes a position: if you name a layer pattern, you mean it. Frozen and off layers that match the pattern are forced visible before rendering. You asked to see the property boundaries; you get the property boundaries, plot flags notwithstanding.
If you want plot-faithful output, render with a broad pattern against a paperspace sheet — the layout’s own viewport conventions carry most of that intent.
Empty results are errors, not empty files
Section titled “Empty results are errors, not empty files”A pattern that matches no layers returns an error that includes similar layer names as a hint:
{ "error": "No layers match 'C-PORP*'. Similar layers: C-PROP-LINE, C-PROP-BNDY, C-PROP-ESMT"}You never get a silently empty SVG to puzzle over.
Block content and layer “0”
Section titled “Block content and layer “0””Layer filtering applies to top-level entities in the layout. An INSERT (block reference) passes the filter when its own layer matches, and then renders its complete block content — sub-entities inside the block are not individually filtered. This is deliberate: block content drawn on layer 0 legitimately inherits the insert’s layer, and filtering inside blocks would drop valid geometry.
Practical consequence: if a matched layer contains block references, expect their full symbols in the output, not just the fragments that share the layer name.
Performance
Section titled “Performance”Rendering a full sheet of a large civil file (tens of thousands of entities) takes on the order of 10 seconds and can produce multi-megabyte SVGs. Prefer narrow layer patterns — they’re faster, smaller, and more legible. The typical loop is: survey to find a layer, render just that layer, widen only if the picture is missing context.