CAD Overview
Sending Data to CAD#
From anywhere on the SkyCiv platform, you can open CAD with pre-built drawing data using:
Where cad_data is a JSON object following the schema described below.
Top-Level Structure#
settings#
Controls display, snapping, colors, dimensions, and units. All fields are optional — defaults are applied for any omitted values.
| Key | Type | Description |
|---|---|---|
canvasLengthUnits | string | Length unit: "mm", "cm", "m", "ft", "in" |
gridSize | string | Grid spacing value |
snapToGrid | bool | Snap cursor to grid |
snapToPoint | bool | Snap to existing points |
snapToLineEnds | bool | Snap to line endpoints |
snapToLineMid | bool | Snap to line midpoints |
snapToAlign | bool | Snap to alignment guides |
snapToAxis | bool | Snap to axes |
showGrid | bool | Show background grid |
showAxis | bool | Show axis lines |
showVertices | bool | Show vertex markers |
showCreatedDimensions | bool | Show user-created dimensions |
showSelectionDimensions | bool | Show dimensions on selection |
canvasBackgroundColor | string | Hex color for canvas background |
lineColor | string | Default line color |
pointColor | string | Default point color |
dimensionsColor | string | Dimension label color |
selectionColor | string | Selected item color |
highlightColor | string | Hover/highlight color |
dimensionTextSize | string | Font size for dimension labels |
globalDimsScale | string | Global scale for dimension display |
globalTextScale | string | Global scale for text display |
arcSegments | string | Segment count for arc rendering |
circleSegments | string | Segment count for circle rendering |
Full settings object can include many more display/snap/color options. Omit any you don't need — sensible defaults are used.
s3d (Structural 3D Settings)#
Optional. Used when the CAD drawing maps to a structural model.
canvases#
Array of canvas (drawing) objects. Each canvas contains all the geometry, annotations, and metadata for one drawing sheet.
Canvas Element Types#
Points#
Lines#
A straight segment between two points.
Tip: To create a closed polygon, create multiple lines that share endpoints and assign the same
groupId.
Polylines — Circle#
Polylines — Arc#
Defined by three points: start, end, and a mid/control point on the arc.
Dimensions (Linear)#
Leader Texts#
An arrow from a point to a text label.
Multi-Leader Texts#
A text annotation with multiple arrow leaders.
Texts#
Tables#
Axes (Gridlines)#
A labeled axis/gridline between two points.
Construction Lines#
Infinite reference lines defined by a point and angle (in degrees).
Revision Clouds — Rectangle#
Rectangular revision cloud defined by bounding box.
Revision Clouds — Circular#
The
arcsarray is typically auto-generated. When creating revision clouds programmatically, provide the bounding box (minX,minY,maxX,maxY) andarcRadius— the renderer will compute the scallop arcs.
Hatches#
A filled region defined by one or more closed loops.
Each loop is a closed boundary. Segments within a loop can be "line" or "arc" types.
Blocks#
Blocks allow you to define reusable groups of drawing elements.
Block References (Definitions)#
Supported item types inside a block: point, line, arc, dimension, multiLeaderText, hatch.
Block Instances#
Place a block definition on the canvas with position, rotation, and scale.
Layers#
Assign canvas items to layers for organization, color, and visibility control.
Items reference elements by their type and id. When displayColorByLayers is enabled in settings, items inherit the layer color.
Minimal Example#
A simple drawing with one line and one circle:
Send it: