Parametric drawing
Parametric drawing ties relationships and measurements to the geometry, as in AutoCAD: two lines stay perpendicular, a side stays at 40, the door width is half the wall. Whoever changes a constrained object sees the connected objects adjust along with it. There are two kinds of constraint:
- geometric constraints hold relationships (horizontal, parallel, tangent, coincident...) and appear as icons in the constraint bars near each object;
- dimensional constraints hold measurements (distance, angle, radius, diameter) with a name and an expression (
d1 = 40,d2 = d1/2) and appear as dimensions with a lock.
The buttons are on the Parametric tab of the ribbon, in the Geometric, Dimensional and Manage panels.


Geometric constraints: GEOMCONSTRAINT (alias GCON)
GEOMCONSTRAINT asks for the type and then the objects; each type also has its own command (the buttons in the Geometric panel). The type prompt shows the last type used between < and > (<Coincident> the first time): Enter repeats that type. The second object adjusts to the first, which stays where it is. A constraint that would over-constrain the geometry or that conflicts with existing ones is not applied, and the command line says why.
| Type (option) | Command | What it holds | Options |
|---|---|---|---|
Horizontal (H) | GCHORIZONTAL | A line (or two points) horizontal | 2Points (2P) |
Vertical (V) | GCVERTICAL | A line (or two points) vertical | 2Points (2P) |
Perpendicular (P) | GCPERPENDICULAR | Two lines at 90° (the second one rotates) | — |
Parallel (PA) | GCPARALLEL | Two parallel lines (the second one rotates) | — |
Tangent (T) | GCTANGENT | Two tangent curves (line, arc, circle) | — |
Smooth (SM) | GCSMOOTH | The end of a spline with another curve, with no corner and no jump in curvature | — |
Coincident (C) | GCCOINCIDENT | Two points in the same place, or a point on an object | Object (O), Autoconstrain (A) |
Concentric (CON) | GCCONCENTRIC | Circles, arcs and ellipses with the same center | — |
Collinear (COL) | GCCOLLINEAR | Lines on the same straight line | Multiple (M) |
Symmetric (S) | GCSYMMETRIC | Two objects or two points symmetric about a line | 2Points (2P) |
Equal (E) | GCEQUAL | The same length (lines) or the same radius (circles and arcs) | Multiple (M) |
Fix (F) | GCFIX | A point or an object held where it is (for a line or arc, its infinite line or circle; the endpoints slide along it) | Object (O) |
Points are chosen by clicking near an endpoint, a midpoint, a center or a vertex (the constraint point closest to the cursor). Polyline segments count as lines and arcs, and the midpoint of each segment is also a constraint point. On an elliptical arc, the two arc endpoints are constraint points that follow the ellipse when it rotates or changes size. A point object (POINT) counts as a point.
Ellipse axes and texts. As in AutoCAD, where the constraint asks for a line (Horizontal, Vertical, Parallel, Perpendicular, Collinear and the axis of Symmetric), clicking an ellipse picks the ellipse axis closest to the click (the major or the minor one, whole, from end to end): the ellipse then moves and rotates with the line that the axis is tied to. A single-line text (TEXT) counts as its baseline (click on the letters) and as its text point (the justification point; for Aligned and Fit, the second point). The text does not change size: when the line its baseline is tied to rotates, it rotates around its own point; when the object its point is tied to moves, it goes along without rotating.
AUTOCONSTRAIN and CONSTRAINTINFER
AUTOCONSTRAIN applies to the chosen objects the constraints that the geometry already nearly satisfies: corners that touch become coincident, nearly horizontal lines become horizontal, and so on. As in AutoCAD, ellipse axes and text baselines count as lines (a major axis on the same straight line as a line becomes collinear; a text aligned with a line, parallel to it), constraints inside each polyline (between its segments) come before those between objects, and Equal is turned off (AutoCAD's AUTOCONSTRAIN does not tie lines or circles of the same size; turn it on in the tab if you want). Like AutoCAD's, it accepts a parallel between two lines that are already held only by the two axes of the same ellipse (which are perpendicular to each other). The types, the priority order and the tolerances are on the AutoConstrain tab of Constraint Settings (the command's Settings option, S, opens that tab).
AUTOCONSTRAIN handles selections of thousands of objects: objects that touch are found through a spatial index, and lines with the same direction (parallel, collinear) or the same length (equal) are tied in sequence, without comparing every one with every other one. Each group of connected objects is checked separately. Between groups that do not touch (two separate rectangles, for example), parallel, collinear and equal constraints are only added while the resulting group stays small (up to 32 objects), so that the drawing does not turn into a single system that is slow to solve.
With CONSTRAINTINFER on (1), commands that create objects (LINE, PLINE, CIRCLE, ARC, RECTANG, copies...) get the constraints the drawing suggests, in the same undo step: coincident where the click came from a point snap and between segments drawn in sequence, perpendicular and tangent from the snaps of those names, parallel when the point came from the Parallel snap (parallel to the acquired line), horizontal and vertical on straight segments drawn with Ortho or with polar tracking (F10) at 0° or 90°.
Dimensional constraints: DIMCONSTRAINT (alias DCON)
DIMCONSTRAINT asks for the type (or an associative dimension to convert); each type also has its own command:
| Type (option) | Command | Measures |
|---|---|---|
Linear (LI) | DCLINEAR | The horizontal or vertical distance between two points, depending on where the dimension is placed |
Horizontal (H) | DCHORIZONTAL | The horizontal distance |
Vertical (V) | DCVERTICAL | The vertical distance |
Aligned (A, the default) | DCALIGNED | The distance between two points, a point and a line (Point & line, P) or two lines (2Lines, 2L: the second becomes parallel to the first) |
Angular (AN) | DCANGULAR | The angle between two lines, the sweep of an arc or the angle by 3Point (3P, the Enter default: the vertex and the two points) |
Radius (R) | DCRADIUS | The radius of a circle or arc |
Diameter (D) | DCDIAMETER | The diameter of a circle or arc |
Convert (C) | DCCONVERT | Turns associative dimensions into constraints |
Form (F) | DCFORM | Chooses the form of the next constraints |
After the points (or Object, O) and the dimension line location, the command line shows the dimension text: Enter accepts the current measurement, or type name=expression (largura=40) or just the expression.
Aligned: Point & line and 2Lines. At the first point prompt of DCALIGNED (or of DIMCONSTRAINT's Aligned), P asks for a point and then the line (or, with Enter or L, the line and then the point): the dimension measures the distance from the point to the line's infinite line. 2L asks for two lines: the second becomes parallel to the first, at the dimension's distance.
Angular by 3 points. In DCANGULAR (and in DIMCONSTRAINT's Angular), Enter (or 3P) at the first line prompt asks for the angle vertex and the two points; the dimension measures the angle at the vertex, from the first to the second point (the smaller of the two sides), with the extension lines from the vertex to the dimension arc.
Names. Each dimensional constraint is a named parameter: d1, d2... for distances, ang1 for angles, rad1 for radii and dia1 for diameters. The name is not case-sensitive and must be unique among the parameters (letters, digits and _, starting with a letter).
Expressions. The expression can reference other parameters and use + - * / ^, parentheses, the constants pi and e and the functions sin, cos, tan, asin, acos, atan, sqrt, abs, round, trunc, floor, ceil, ln, log, exp, exp10, pow, min, max, sign, d2r and r2d. The decimal separator is the period; the comma separates arguments. Angles are in degrees (trigonometric functions too); a number can carry deg, d or ° (degrees), rad or r (radians) and grad or g (grads): 30d is 30°. A cycle (d1 = d2, d2 = d1) or an unknown name is rejected.
Units in lengths. Lengths are in the drawing's unit, and a number can carry a unit: mm, cm, dm, m, km, in, ft, yd and mi. The unit is converted to the drawing's: in a BadBit CAD drawing (in meters), 250mm is 0.25; in a DXF or DWG in millimeters (its unit, INSUNITS), 2.5m is 2500. In a unitless drawing, a length with a unit is rejected (there is nothing to convert to).
Forms. A dynamic constraint (the default, CCONSTRAINTFORM 0) appears only on screen, at a fixed screen size, and does not plot; the value in its text uses the language's decimal separator (d1=40.00 in English, d1=40,00 in Portuguese), like the Value column of the Parameters Manager. An annotational one (1) is a real dimension, with the current dimension style, and plots. The Dynamic mode and Annotational mode buttons in the Dimensional panel switch the form of the next ones.
Reference dimensions. When the constraint would over-constrain the geometry, AutoCAD and BadBit CAD offer to create it as a reference dimension (CR): it measures and follows the geometry, but does not drive it. The text comes in parentheses and has no lock.
DCDISPLAY shows (S) or hides (H) the dynamic constraints of the chosen objects; DYNCONSTRAINTDISPLAY hides all of them at once.
Value grips
With a constrained object selected, the ends of the constraint dimension get triangular grips. Dragging one of them changes the constraint's value (the geometry goes along); typing a number at that moment uses that number.

Parameters Manager: PARAMETERS (aliases PAR, PARAM)
PARAMETERS opens the palette with all the drawing's parameters: the dimensional constraints and the user variables. The palette does not block the drawing.

- In-cell editing. Click the name, the expression or (for variables) the description to edit; Enter confirms, Esc cancels. Renaming updates the expressions that reference the parameter. Changing a constraint's expression changes the geometry immediately. An error (invalid or duplicate name, invalid expression, cycle, geometry with no solution) appears in the palette and nothing changes.
- New variable creates
user1 = 1with the name already in edit mode. - Delete erases the selected parameter. A parameter referenced in another one's expression is not removed (the palette says which).
- Filter by text (in the name, the expression or the description) and by group: All, Dimensional constraints, User variables and Used in expressions.
- Sort: click a column header; another click reverses the order.
Each change is an undo step. -PARAMETERS does the same from the command line: New (N), Edit (E), Rename (R), Delete (D) and list (?, accepts * and ? in the name).
Constraint bars: CONSTRAINTBAR (alias CBAR)
Each object with geometric constraints shows, near it, a small semi-transparent bar with the icon of each constraint; coincident constraints appear as a small square at the point. Hovering over an icon highlights the objects tied by that constraint (and its icon in the other bars) and shows its name.

- Dragging the bar (click it and drag) puts it somewhere else; it stays at that distance from the object, also when zooming and when the object moves.
- The x that appears at the end of the bar when the mouse is over it hides it.
- Right-clicking an icon opens the menu: Delete this constraint, Hide this bar, Hide all bars and Constraint bar settings….
- CONSTRAINTBAR shows (
S), hides (H) or resets (R: shows the bar and returns a dragged bar to its automatic position, near the object) the bars of the chosen objects; with no objects, Showall (S, the default) and Hideall (H). The Show all and Hide all buttons in the Geometric panel do the same. - DELCONSTRAINT (alias DELCON) removes all constraints from the chosen objects. Expressions that referenced a removed dimensional constraint take its value.
Constraint Settings: CONSTRAINTSETTINGS (alias CSETTINGS)
The dialog box has AutoCAD's three tabs; OK saves, Cancel discards.

- Geometric: infer constraints (CONSTRAINTINFER); the types shown in the bars (CONSTRAINTBARMODE), with Select all and Clear all; show the bars (CONSTRAINTBARDISPLAY); the bars' transparency (0 to 90%).
- Dimensional: show all dynamic constraints (DYNCONSTRAINTDISPLAY); the dimensions' name format (CONSTRAINTNAMEFORMAT): Name (
d1), Value (40.00) or Name and expression (d1=40.00, the default); the value's decimal places; and the lock on constraint dimensions (this choice goes to the user profile). - AutoConstrain: the types AUTOCONSTRAIN applies, in priority order (select one and use Move up and Move down; the check box turns the type on or off); Tangent objects must share an intersection point; Perpendicular objects must share an intersection point; and the distance (in the drawing's unit) and angle (in degrees) tolerances.


Editing with constraints
Moving, stretching or rotating a constrained object (with grips, MOVE, STRETCH and the other commands) takes along the objects tied to it by constraints. During the drag, the live preview shows the connected objects already adjusted and, as in AutoCAD, their original geometry disappears from the screen until the button is released (nothing is left dashed on top). Large drawings are solved off screen, without freezing the interface.

How the geometry moves, as in AutoCAD: of the line the user moved, the endpoint they dragged stays put (the one that moved the most; in a tie, the start), and the line keeps the length and direction they gave it as far as the constraints allow. A rotated horizontal line returns to horizontal around the endpoint that moved, with the same length; stretched by one endpoint, that endpoint stays where it was placed and the other follows; with a length dimension, the stretched endpoint stays and the line keeps its direction. Connected lines that were not touched move whole, without stretching or rotating unless they need to (a rectangle with one side moved moves as a whole); when they need to rotate, they rotate around their start. When the corner of a rectangle made of horizontal and vertical lines is stretched (both lines of the corner at once), the left side keeps its length and the other lines, from left to right, keep theirs: with the top right corner dragged, the left side stays where it was (it only goes up) and the top and bottom sides stretch, as in AutoCAD. When the corner of a polygon held by parallel and perpendicular constraints (no horizontal or vertical) is stretched, one of the two lines of the corner stays whole, where the user placed it: the first one that entered the constraint network (that of the first constraint created), as in AutoCAD; the others adjust to it. In the rectangle, of the two lines tied to the endpoints of the one that stays whole, the left one stays rigid when the two are separated horizontally; otherwise, the free endpoint of the line that was not touched goes to the foot of the perpendicular and the opposite side rotates around where it was, as AutoCAD does in most cases. A spline held by smooth only to a line or to the straight end segment of a polyline goes along, without deforming, when that segment is moved. When that segment is rotated, or the other spline of a smooth between two splines is moved, the spline that has only that smooth settles as in AutoCAD: it moves whole and only the junction vertex and one inner vertex change (the second or third counting from the junction). When the value of a constraint dimension changes, its first point stays: a line's dimension changes its end; a dimension between two lines moves the second one. With a Fix point on the edited line, it straightens first and then goes to the fixed point with the other endpoint as close as possible to where it was. Fix on a whole object holds, for a line (and a straight polyline segment), its infinite line, and for an arc (and an arc segment), its circle: the endpoints slide along it, as in AutoCAD. The fixed side of a rectangle stretches when the top side goes up (the bottom one stays); a fixed line stretched in its own direction grows, and when pulled off its infinite line it stays as it was; the endpoint of a fixed arc slides along its circle. For a polyline stretched by a vertex, when it is not possible to leave all of them where the user placed them, the dragged vertex stays and the others slide.
When the requested edit has no solution with the constraints (pulling the endpoint of a fixed line, for example), the edit does not happen and the command line says so. With CONSTRAINTRELAX on (1), the constraints that prevent the edit are relaxed (removed) and the edit happens.
Undo and redo leave the constraints satisfied: if the restored state has an unsatisfied constraint (a drawing that came in that way from outside, for example), it is solved again in the same step. Changes made by scripts go through the constraints like commands do.
Constraints in DXF and DWG
The associative network of an AutoCAD file (geometric and dimensional constraints, user parameters, actions of associative surfaces) comes back whole when saving to DXF or DWG, in the same version and in any other (DWG 2000 to 2018, DXF 2010 and 2018), in the format AutoCAD writes in each version: AutoCAD keeps the constraints when it opens the file. AutoCAD's constraints become BadBit CAD constraints: they appear in the constraint bars and in the Parameters Manager, with AutoCAD's names and expressions, and are edited like those made here. Saving without changing any of them, the network comes back exactly as it came; changing any, it is rebuilt in AutoCAD's format. Constraints on the whole axis of an ellipse and on a text (like those AutoCAD's AUTOCONSTRAIN creates) also become BadBit CAD constraints. A constraint that BadBit CAD does not have leaves its group as it came, without editing, with a message when reading. The reserved layer for the dimensions of dynamic constraints keeps AutoCAD's name, *ADSK_CONSTRAINTS (the * marks a system layer: the user cannot create a layer with it). An associative loft surface (LOFT, with the cross sections, guides and path) goes to all versions of DWG and DXF the way AutoCAD writes it: from 2013 on its parameters are in the action; from 2000 to 2010, in the action's body, flagged for AutoCAD to re-evaluate on opening. What does not fit in the chosen version (the actions of other associative surfaces before 2013) or depends on an object deleted in BadBit CAD is left out of the file entirely, together with what depends on it, with a message in the save report.
Constraints and variables created in BadBit CAD go to DXF and DWG (DWG 2000 to 2018, DXF 2010 and 2018) in the format AutoCAD itself writes: when the file is opened in AutoCAD, the constraints work (moving, rotating or changing a parameter takes the connected objects along) and appear in the Parameters Manager with the same name and expression. All geometric types go, including smooth (between two splines and between a spline and a line, an arc or the end of a polyline) and those on splines (by control vertices, point on curve and fix; also splines made by fit points and the closed spline AutoCAD makes), on the end of the ellipse's major axis, on the whole ellipse axes, on texts and on paper space objects of layouts, plus the dimensional constraints (dynamic, annotational and reference) and the user variables, including expressions that use other parameters. The dimensions of dynamic constraints go on the reserved layer *ADSK_CONSTRAINTS, as AutoCAD does.
These stay only in the .bbd file, with a message when saving: those on closed periodic splines (AutoCAD renumbers their vertices on opening and does not reopen correctly even those it creates itself), those on whole splines other than point on curve or fix, those that tie objects in different spaces, and all of them in DXF R12, which has nowhere to store them. AutoCAD's constraints on splines (also smooth with another spline, with a line and with an arc, splines by fit points, closed and periodic ones), on the end of the ellipse's major axis and in paper space also become BadBit CAD constraints when reading.
Parametric drawing variables
| Variable | What it controls | Values | Default |
|---|---|---|---|
| CCONSTRAINTFORM | Form of new dimensional constraints: 0 dynamic, 1 annotational | 0 or 1 | 0 |
| CONSTRAINTBARDISPLAY | Show constraint bars | 0 or 1 | 1 |
| CONSTRAINTBARMODE | Types shown in the bars (sum: horizontal 1, vertical 2, perpendicular 4, parallel 8, tangent 16, smooth 32, coincident 64, concentric 128, collinear 256, symmetric 512, equal 1024, fix 2048) | 0 to 4095 | 4095 |
| CONSTRAINTINFER | Infer constraints while drawing and editing | 0 or 1 | 0 |
| CONSTRAINTNAMEFORMAT | Text of constraint dimensions: 0 name, 1 value, 2 name and expression | 0 to 2 | 2 |
| CONSTRAINTRELAX | Relax the constraints that prevent an edit | 0 or 1 | 0 |
| DYNCONSTRAINTDISPLAY | Show dynamic constraints | 0 or 1 | 1 |
All of them can be typed by name on the command line or set with SETVAR.