Automatic Inferencing
The Onshape sketch editor has the ability to assign constraints to certain entities automatically. For example, create a line and hover one of the endpoints above the origin and a dotted line appears indicating a vertical inference between that endpoint and the origin.
When sketching, Onshape displays inferences for Horizontal and Vertical alignment between an entity and the origin and/or another entity. In some cases, inference only occurs when the cursor is moved near another entity to 'wake up' the inferencing between the two entities. Some commonly used wake up inferences are: horizontal, vertical, midpoint, parallel, and coincident.
The Onshape sketch editor has the ability to assign constraints to certain entities automatically. When sketching, Onshape displays inferences for horizontal and vertical alignment between an entity and the origin and/or another entity. In some cases, inference only occurs when the cursor is moved near another entity to "wake up" the inferencing between the two entities. Some commonly used wake up inferences are: horizontal, vertical, midpoint, parallel, and coincident.
You can elect to use or ignore inferences. In the first example, choose the Line sketch tool from the sketch toolbar. Draw the line straight down. Notice that the yellow dashed line indicates a vertical constraint. This is how inferencing works on a single entity.
In the second example, a circle is sketched. Select the Line sketch tool from the sketch toolbar. Hover over the center point of the circle. This "wakes up" automatic inferencing between the entities. Create a line from the center of the circle to the edge of the circle and a coincident constraint is applied. To disable automatic inferencing, hold the Shift key while clicking to finalize the sketch entity. The coincident constraint is no longer applied.
Automatic inferencing can also happen between two shapes. In a third example, a rectangle is sketched. Select the Center point circle sketch tool from the sketch toolbar. Hover over the midpoint on the edge of the rectangle. This indicates a parallel constraint between the rectangle and the circle. Create the circle. To make a circle that is at the midpoint of the rectangle, hover over the midpoint and drag the circle outward. Click the circle radius on one of the rectangle corners to make the circle coincident with the rectangle.
These are some examples of different ways automatic inferencing can be used.
Steps
- Create two lines with a perpendicular constraint between them.
- Move cursor near line until inferencing ‘wakes up’.
- Draw a line.
When sketching, Onshape indicates relationships with other sketch entities. In the illustration below, the bottom (blue) line is the one being drawn. When it is parallel to the other line it turns to a dotted line and the other is highlighted in orange to show that there is a relation present. (The parallel constraint icon is also visible in this example.)
To suppress automatic inferences, press the Shift key when mousing.