Working with Constraints
Constraints are available and viewable when a sketch is being created or otherwise open for editing.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
Constraints applied between entities in two sketches (for instance, when you Use an entity from one sketch in another sketch) are differentiated by a blue background. Constraints may be applied manually and some are created when geometry is created as you sketch. Upon hover, the referenced constraint’s background is a darker blue:
The Use constraint shown above (with the blue background) constrains a vertex in the rectangle’s sketch with the center point of the circle in the circle’s sketch.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
![](Resources/Images/icons/help-video@2x.png)
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
The Constraints sketch tools allow you to view and alter constraints when a sketch is being created or otherwise open for editing. Constraints applied between entities in two sketches (for instance, when you use an entity from one sketch in another sketch) are differentiated by a blue background. Constraints may be applied manually and some are created when geometry is created as you sketch. Upon hover, the referenced constraint’s background is a darker blue.
Several constraints are available: Coincident, Concentric, Parallel, Tangent, Horizontal, Vertical, Perpendicular, Equal, Midpoint, Normal, Pierce, Symmetric, Fix, and Curvature. Constraints can be added to a sketch automatically, using inference, or manually using the toolbar.
In this example, a midpoint constraint is added between a vertical construction line and a circle. Select the midpoint of the circle and the construction line. Click the Midpoint constraint on the sketch toolbar. This process can be emulated for the different constraints. Alternatively, you can first select the Midpoint constraint tool from the sketch toolbar and then select the construction line and circle.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
To apply a drawing constraint, either:
-
Select the constraint from the menu (or use it's corresponding shortcut key) and select the entities to which the constraint is applied in the sketch.
-
Select the sketch entities and click the constraint on the toolbar's constraint menu.
The following constraints are available from the toolbar constraints menu:
-
Coincident - Make 2 or more sketch entities share the same location in a sketch.
-
Concentric - Make any point coincident with the center of an arc or circle. Make selected arcs and circles share a center point.
-
Parallel - Make 2 or more lines parallel.
-
Tangent - Make a tangent relation between 2 sketch entities, or between a sketch entity and a plane.
-
Horizontal - Constrain 1 or more lines, or a set of points, to be horizontal.
-
Vertical - Constrain 1 or more lines, or a set of points, to be vertical.
-
Perpendicular - Make 2 lines perpendicular.
-
Equal - Make multiple lines equal in length, or multiple arcs equal in radii.
-
Midpoint - Constrain a sketch point to the midpoint of a line or arc.
-
Normal - Make a curve and line, or a curve and plane, perpendicular.
-
Pierce - Make a sketch entity coincident with another entity outside the active sketch plane.
-
Symmetric - Make 2 entities of the same type symmetric, relative to a line, plane, or linear edge.
-
Fix - Lock a sketch entity onto the sketch plane so it does not move.
-
Curvature - Create curvature continuous transitions between sketch splines or conics and surrounding geometry.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
With a sketch open, hover over a sketch entity, like a line or arc, to see the constraints for that entity. As you move the mouse to hover over entities, constraints will appear only for the highlighted entity. To keep all constraints visible, use the Shift key as you move the mouse.
Entities are highlighted in orange upon hover, with the exception of referenced constraints which have a blue background and a darker blue background upon hover. Related entities are highlighted with yellow, as when you select a constraint and the coordinating entities is also highlighted.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
These constraints are not available in the Constraint section of the toolbar, but are created automatically during specific actions as described below:
-
Quadrant - Constrains a point to be coincident to an ellipse and either the major or minor axis of that ellipse. Can be made by inference, dragging something to, or placing something on one of the points on an ellipse.
-
Use - Constrains a sketch entity in one sketch to an entity in another sketch; made by selecting the Use tool and then an entity (sketch entity, face, or edge) in a different sketch or feature.
-
Intersection - Constrains the end points of an open curve (resulting from using the Intersection tool) with Pierce constraints
so that they lie on the edges of the intersected face; for a closed curve, constrains the sketch entities with Intersection constraints.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
The color of sketch entities indicate its constrained status:
- Blue means under-constrained.
- Black means fully constrained.
- Red means a constraint problem (over-constrained).
The color of a constraint icon indicates its constrained status:
- Black on gray means well-defined.
- White on red indicates a problem.
- When selecting, non-fully constrained sketch points (blue and red) are prioritized over any overlapping, fully constrained sketch points (black).
Adding more dimensions or constraints will further constrain the sketch. Dragging entities may help you understand what constraints or dimensions you may want to add.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
You have the ability to interact with constraint icons:
- Click and drag the icon or group of icons to a different location.
- Hover over a single constraint icon to see which entities are highlighted, indicating the constraint applies to them.
- Delete a constraint: click a single constraint icon and press Delete or select Delete from the context menu.
- In the Sketch dialog, check Show constraints to display all constraints defined for the sketch.
- Conflicting constraints are shown as white symbols on a red background.
When sketching, constraint indicators appear next to the mouse cursor as the curves snap to inferences.
![Closed](../Skins/Default/Stylesheets/Images/transparent.gif)
Add, apply, and edit constraints to help define a part in Onshape. Constraints are listed in the sketch dialog when a sketch is being created or otherwise open for editing.
Constraints may be applied between entities in a sketch or between entities in two or more sketches (for instance, when you Use an entity from one sketch in another sketch). Constrains are able to be applied manually and some are created when geometry is created as you sketch. See Automatic Inferencing for more information on automatically created constraints.
In the sketch dialog, tap on a constraint in the list to highlight the relevant sketch geometry. For example, if two lines are constrained horizontally to each other and you tap the horizontal constraint, both lines are highlighted.
Add, apply, and edit constraints to help define a part in Onshape. Constraints are only available and viewable when a sketch is being created or otherwise open for editing.
For information on using specific constraints while on a mobile device, see the specific constraint topic.