2D CAD Commands & Shortcuts Guide
Complete command-line syntax, relative/polar coordinates, OSNAP legend, and keyboard shortcuts for Online CAD Editor.
Fast Keyboard & Command-Line Drafting in Your Browser
Learning 2D CAD commands turns slow mouse clicks into exact millimeter geometry. The command prompt (CMD>) at the bottom of Online CAD Editor accepts classic CAD command names, one-letter aliases, absolute coordinates, relative offsets, and polar distances so you can draft parts without taking your hands off the keyboard.
Complete Command-Line Reference
Type any command below into the CMD> bar and press Enter. Commands are case-insensitive.
| Command | Alias | Syntax Example | What It Does |
|---|---|---|---|
LINE |
L |
LINE 0,0 120,0 |
Draws a straight segment between two coordinates (or activates Line tool if no coordinates given). |
PLINE |
PL |
PLINE |
Activates multi-vertex Polyline drafting. Press Enter or right-click to finish. |
RECT |
R, REC |
RECT 0,0 160,90 |
Creates a rectangle defined by two opposite corner coordinates. |
CIRCLE |
C |
CIRCLE 60,40 18 |
Draws a circle by center X,Y and radius R. |
ARC |
A |
ARC |
Starts 3-Point Arc drafting (start point, point on curve, end point). |
POL |
P |
POL |
Starts regular 6-sided Polygon (hexagon) drafting from center to vertex radius. |
DIM |
D |
DIM 0,-12 120,-12 |
Places a linear dimension line with automatic distance readout on the Dimensions layer. |
TEXT |
T |
TEXT 10,95 FRONT PANEL |
Inserts a text callout at X,Y on the Notes layer. |
GRID |
— | GRID 5 |
Sets active grid spacing (e.g., 5 mm or 0.25 in). |
ZOOM |
Z, ZE |
ZOOM |
Zooms and centers the viewport to fit all visible drawing entities. |
UNDO |
U |
UNDO |
Reverts the last drafting or property edit step. |
REDO |
— | REDO |
Restores an undone action. |
CLEAR |
— | CLEAR |
Clears all entities from the current canvas (undoable with UNDO). |
Coordinate Entry Syntax: Absolute, Relative, and Polar
Online CAD Editor uses a standard right-handed 2D Cartesian coordinate plane where +X runs right and +Y runs upward:
- Absolute Coordinates (
X,Y): Measured from the global(0, 0)origin. Example:LINE 20,10 140,10draws a 120-unit horizontal line starting 20 units right and 10 units up from origin. - Relative Cartesian (
@dX,dY): Measured from the previous point. Example:LINE 20,10 @120,0creates the exact same 120-unit horizontal segment without calculating the ending X coordinate manually. - Relative Polar (
@Distance<Angle): Specifies length and counter-clockwise angle in degrees (0°= right,90°= up,180°= left,270°= down). Example:LINE 0,0 @80<45draws an 80-unit diagonal line at 45 degrees.
You can also click a start point on the canvas with your mouse, then type @50,0 or 100,40 into CMD> and press Enter to lock the second point with mathematical precision.
Single-Key Drafting Shortcuts
When your cursor is outside a text field, single-key shortcuts switch tools immediately:
V— Select & Move (click to inspect in Properties, drag to reposition)H— Pan Canvas (or hold middle mouse button from any tool)L— Line,R— Rectangle,C— Circle,A— 3-Point Arc,P— HexagonD— Linear Dimension,T— Text CalloutZ— Zoom Fit / ExtentsCtrl+Z/Cmd+Z— Undo,Ctrl+Y/Cmd+Y— RedoDelete/Backspace— Delete Selected EntityEsc— Cancel active draft and return to Select mode
Understanding Object Snaps (OSNAP)
When OSNAP is enabled in the bottom status bar, hovering within 12 screen pixels of key geometric anchor points displays a color-coded marker and snaps your next click automatically:
- Green Square (
Endpoint): Snaps cleanly to line endpoints, rectangle corners, polyline vertices, and arc ends so closed cut contours have zero gaps. - Blue Triangle (
Midpoint): Snaps to the exact center of any line or polyline segment—ideal for placing centered mounting holes or symmetry centerlines. - Amber Circle (
Center): Snaps to the geometric center of circles, arcs, and rectangles for concentric bores and bolt circles.
Ready to try these commands live? Open Online CAD Editor, convert vector graphics with SVG to DXF Converter, or plot sheets with DXF to PDF Converter.
Frequently Asked Questions
Can I draw exact parts by typing coordinates instead of dragging the mouse?
Yes. You can enter commands such as LINE 0,0 100,0, CIRCLE 50,50 20, or RECT 0,0 120,80 directly in the CMD> bar at the bottom of the Online CAD Editor workspace.
How do relative and polar coordinates work in 2D CAD commands?
Prefix relative distances with @. Use @dX,dY for horizontal and vertical offsets (for example @50,0) or @Length<Angle for polar angles in degrees (for example @60<45).
How do I delete or undo a geometry step quickly?
Click any entity in Select mode (V) and press Delete or Backspace, or click the Delete button at the top of the Properties panel. Press Ctrl+Z (or Cmd+Z on macOS) to undo.
How do I lock lines strictly horizontal or vertical?
Click the ORTHO toggle in the bottom status bar. While ORTHO is highlighted, new lines and dimensions lock automatically to horizontal (0/180 deg) or vertical (90/270 deg) axes.
How do I change the grid spacing in Online CAD Editor?
Type GRID followed by a number—such as GRID 5 for 5 mm spacing or GRID 0.5 for half-inch spacing—and press Enter. The grid display and grid snap update immediately.