Constraints and dimensions
Lock a sketch down so it changes the way you intend and not in three other places you did not.
By the end you can
- Tell the difference between a constraint and a dimension, and know when to reach for each
- Fully define a sketch so every point is locked by geometry or a number
- Recognise why an under-defined sketch breaks when a teammate edits it
On this page · 5 sections
The previous lesson ended on a rule: fully define every sketch. This one is about the two tools that actually do it.
Constraints say what stays true
A constraint is a relationship that holds no matter what the numbers become. Two lines are perpendicular. This circle is concentric with that one. These four holes are all the same diameter.
- Coincident
- Two points occupy the same location. The most common constraint in any sketch, and usually applied automatically as you draw.
- Horizontal / Vertical
- A line stays aligned to the sketch axes. Cheap to apply and removes two degrees of freedom at once.
- Equal
- Two entities share a size. One dimension then drives both, which is exactly what you want for a symmetric bracket.
- Concentric
- Two circles or arcs share a centre. This is how a bolt hole stays in the middle of a boss when the boss moves.
- Tangent
- A line meets an arc smoothly. Essential for anything that a belt, chain, or finger has to travel along.
Dimensions say how big
A dimension is a number: 96 mm between hole centres, 8 mm radius, 30 degrees. Dimensions remove the remaining freedom once constraints have described the shape.
The order matters more than people expect.
Constrain first, dimension second
Describe the relationships before you type any numbers. A sketch that is constrained properly needs far fewer dimensions, and the dimensions it does need are the ones a build team would actually measure.
If you dimension first, you end up pinning every point with coordinates. It looks defined, but change one number and nothing else follows — because you never told Onshape which relationships were supposed to survive.
Reading the colours
Onshape tells you the state of a sketch by colour, and it is worth learning to read at a glance:
- Blue — under-defined. The geometry can still move.
- Black — fully defined. Every point is locked by a constraint or a dimension.
- Red — over-defined. You have told Onshape two contradictory things.
- Yellow — a snap or inferred relationship being offered while you draw.
Over-defined is not 'extra safe'
Red means conflict, not thoroughness. It usually happens when you dimension something a constraint already controlled — for example dimensioning both halves of a shape that is already symmetric. Delete the redundant dimension rather than the constraint; the constraint is the part carrying your intent.
Doing it on a real part
-
Sketch a drivetrain side plate outline. A rectangle is fine to start. Do not type any numbers yet.
-
Add the relationships. Make the top and bottom horizontal, the sides vertical, and the whole thing symmetric about the origin using a midpoint constraint.
-
Now dimension it. Length and height only. Watch the geometry turn black.
-
Add a bolt pattern. Sketch one hole, constrain it concentric to nothing yet — just place it — then dimension it from the plate edge with the numbers your actual hole pattern uses.
-
Change a number. Edit the plate length and confirm the holes move the way you expected. If anything drifts somewhere unexpected, the sketch is telling you a relationship is missing.
Why step 5 is the real test
A sketch is not finished when it turns black. It is finished when you can change a driving dimension and everything downstream moves sensibly. That is the difference between a model that survives a design review and one that gets rebuilt from scratch in January.
Check yourself
You need two mounting holes to always sit the same distance from each end of a plate, even when the plate length changes. What is the right way to set that up?
Next
You have been sketching on the default planes. The next lesson covers making your own — which is what you need the moment a part is not conveniently flat.
Finished this lesson?
Mark it complete to track your progress.