This is an old revision of the document!
Table of Contents
Nutcracker Assembly Tutorial
In this tutorial, we will assemble a nutcracker in Onshape. The parts have already been modeled. Our goal is to connect them using different types of Mates and make sure the mechanism can move correctly.
A Mate defines how two parts are connected and how they can move relative to each other. We will use Fastened, Revolute, Slider, Planar, and Cylindrical Mates.
1. Insert the parts
Open the Assembly tab. Start by inserting the Base part:
- Click Insert (1).
- Select Base from the list of available parts (2).
- Accept the insertion (3).
The Base will be the stationary part of our assembly. Right-click Base in the Instances list and select Fix. This prevents it from moving or rotating when we add the other parts.
Use Insert again to add all the other parts. Insert one instance of each part, except for Connection, which must be inserted twice. You can place the parts anywhere in the graphics area for now; the Mates will position them correctly.
2. Attach the fixed parts (Fastened Mate)
First, we will attach the parts that should not move relative to the Base.
A Fastened Mate joins two parts rigidly. It prevents all relative movement: the parts cannot slide or rotate independently. We will use it to attach Hinge, Cylinder, and Adjuster Base to Base.
Let's start with Hinge:
- Activate Fastened Mate.
- Select the connection point on Hinge, as shown below.
- Select the matching connection point on Base.
Onshape uses Mate connectors to align the parts. A Mate connector is a small local coordinate system that defines the position and direction of the connection. When you hover over a face or a circular edge, Onshape can show a suitable connector automatically.
Check the position and orientation of Hinge. If everything looks correct, click the green checkmark to accept the Mate.
Repeat the same procedure to attach Cylinder and Adjuster Base to Base. These parts should now remain fixed in place.
3. Attach the Handle (Revolute Mate)
The Handle must rotate around the Hinge. For this connection, we will use a Revolute Mate.
A Revolute Mate allows rotation around one axis but prevents other relative movements. It works like a simple hinge: the connected parts stay together, but one can rotate around the joint.
- Activate Revolute Mate.
- Select the center of the lower connection hole on Handle.
- Select the matching hole on Hinge.
Check the position of Handle before accepting the Mate. If the parts face the wrong direction, use Flip primary axis to reverse the Mate connector's Z-axis direction.
Accept the Mate, then drag Handle to check that it rotates around the intended axis.
4. Add the sliding parts (Slider Mate)
The Piston and Adjuster need to move in straight lines. We will use Slider Mates for these movements.
A Slider Mate allows movement along one axis and prevents relative rotation. Imagine a drawer moving along a rail: it can move forward and backward, but it cannot turn freely.
First, connect Adjuster to Adjuster Base:
- Activate Slider Mate.
- Select the Mate connector on the moving part, Adjuster. Make sure its axis follows the intended sliding direction.
- Select the matching Mate connector on the stationary part, Adjuster Base.
If Adjuster faces the wrong direction, use Flip primary axis to reverse the Z axis of the Mate connector.
Set movement limits
Without limits, a Slider Mate may allow the part to move farther than it should. To define an appropriate range of motion, enable Limits in the Slider Mate dialog (1).
You can drag the part to test its movement (2). Onshape displays the displacement value in the graphics area. Use this value to estimate suitable minimum and maximum positions.
For the Adjuster in this example, use the following values:
- Minimum Z: 0 in
- Maximum Z: 2 in
These values allow Adjuster to move within the intended range. Check that it moves in the correct direction and stops at the limits.
Use another Slider Mate to connect Piston to Cylinder, following the same method. Piston should move along the axis of Cylinder without rotating. If necessary, adjust the direction of the Mate connectors and add limits that match the available movement of Piston.
5. Attach the first Connection part
The two Connection parts link the movement of Handle to Piston. Because these parts form a closed mechanical loop, we need to choose the Mates carefully.
In this example, we will use a combination of Planar and Cylindrical Mates. These allow the required movement without adding unnecessary restrictions.
5.1. Align Connection with Handle (Planar Mate)
A Planar Mate keeps two selected planes aligned while allowing movement within the plane and rotation around the plane's normal axis. It prevents the parts from moving away from the plane.
Here, we use it to keep Connection correctly aligned with the side of Handle.
- Activate Planar Mate.
- Select the appropriate flat face on Connection.
- Select the corresponding face on Handle.
Check the alignment. If the faces are oriented incorrectly, use Flip primary axis. Accept the Mate when Connection is on the correct side of Handle.
5.2. Connect Connection to Handle (Cylindrical Mate)
Next, we will define the joint between Connection and Handle.
A Cylindrical Mate allows two movements around the same axis: rotation around the axis and translation along it. It is less restrictive than a Revolute Mate, which allows rotation only.
- Activate Cylindrical Mate.
- Select the connection point at the hole on Connection.
- Select the matching connection point on Handle.
Accept the Mate. Connection should now be aligned with Handle and able to rotate around the selected hole. The Planar Mate helps keep it in the correct plane.
5.3. Connect the other end to Piston
Now connect the free end of Connection to Piston:
- Activate Cylindrical Mate again (1).
- Select the inside circular edge of the free hole on Connection (2).
- Select the corresponding circular edge of the connection hole on Piston.
Check the result and accept the Mate using the green checkmark.
Why not use only Revolute Mates? In a closed mechanism, several Mates may restrict the same movement. This can create redundant or conflicting constraints, and Onshape may report an error. The Planar and Cylindrical Mates used here provide the movement needed by this particular assembly. This does not mean that Revolute Mates are always incorrect in closed mechanisms.
6. Attach the second Connection part
Repeat the previous steps for the second Connection instance:
- Use a Planar Mate to align it with the appropriate side of Handle.
- Use a Cylindrical Mate to connect its first hole to Handle.
- Use another Cylindrical Mate to connect its other hole to Piston.
Make sure both Connection parts are positioned correctly and do not cross or overlap unexpectedly. The completed assembly should look similar to the example below.
7. Check the completed assembly
Before finishing, test the mechanism:
- Base, Hinge, Cylinder, and Adjuster Base should remain stationary.
- Handle should rotate around Hinge.
- Piston should slide inside Cylinder.
- Adjuster should slide within its defined limits.
- Both Connection parts should follow the movement of Handle and Piston.
Drag Handle slowly and observe the other parts. If the mechanism does not move correctly, check the selected Mate connectors, the axis directions, and any Mate errors in the feature list.
Important: Mates define movement, but they do not automatically prevent every possible collision between parts. Use suitable limits where necessary, and check the model throughout its movement.




























