Working with Constraints
Constraints are available and viewable 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:
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.
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.
Viewing constraints
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.
Constraints created automatically
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.
Constraint colors and status
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.
Tips
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.
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.