Modeling a part in the context of surrounding parts is a powerful way to design top-down. Onshape provides two methods of designing parts top-down. Each method has its own strengths, so you might want to use different methods for different designing scenarios.
- Use Onshape multi-part Part Studios when you have a strong understanding of your design intent at the start of your design process, and you want to use the power of a single parametric history to drive several inter-related parts.
- Use In-Context modeling (explained in this topic) when you need relationships between parts that were created in separate Part Studios, or even in different (linked) documents, or when geometric relationships are dependent on assembly position. This often occurs when your Assembly already exists and you need to make some in-context tweaks to one of the parts. This approach also scales well to large assemblies, when it's not feasible to have one parametric history drive all the parts.
In addition to editing existing parts, you are also able to create an entirely new part in-context using the Create Part Studio in context tool.
The Edit in context command is initiated in an Assembly. Select the part you wish to edit, and access the command from the context menu.
Upon initiating the command, Onshape:
- Switches focus to the Part Studio of the part selected
- Displays the assembly as visually ghosted in the Part Studio
- Creates the Context object (a snapshot) when a reference is made by selecting a ghosted entity as a reference point during the edit process
- Captures all the geometry of the components in the Assembly (and stores the information in the Context object)
- Captures the positions of the components in the assembly (and stores the information in the Context object)
Context objects are listed just above the Feature list in the Part Studio, see the illustration of a Part Studio, below:
|List of Context objects in this Part Studio|
|Button to return to the Assembly|
|Ghosted parts involved in the Assembly, in the articulated position at the time Edit in context was initiated|
|Newly created Feature (Extrude new) referencing the face of the assembled parts|
|Opaque parts originally created in this Part Studio; in the position they were created|
When editing In Context, you are able to make as many references as you’d like to any of the parts in the assembly – safe in the knowledge that those references will never be lost or broken, so your part will never fail.
You are also able to create multiple Contexts of the same Assembly in various articulated positions and update a Context, manually, in the Part Studio or Assembly if desired. Updates are never automatic; you control if and when to update and what to update through the Update context command. This prevents accidental changes to in-context parts that might occur as a result of moving or redefining other parts in the Assembly.
In the Assembly, right-click the part you want to edit (called a primary instance), then select Edit in context to open the Part Studio containing that part. The assembled parts are visualized in the Part Studio (ghosted) around the primary instance in the same spacial relationship as in the Assembly. In addition, all parts originally in the Part Studio are displayed, opaque, placed as they were created.
For example, the shears and handles shown in Main Assembly are defined in separate Part Studios. Notice that the blade and limit plate do not meet:
To ensure that the limit plate and blade meet, select the limit plate (the part to edit), right-click and select Edit in context to open the Part Studio in which the limit plate was created, visualized with the assembly:
Extrude up to face, using the blade as a reference point for the Extrude feature:
Return to the Assembly (click Go to assembly) and see the edits there.
If the design intent was clear at the outset, all the parts could have been designed in a single Part Studio. This example assumes the assembly had already been built with parts from different Part Studios, so Edit in context is the best option.
You can create a new Part Studio using the present Context of the Assembly with the Create Part Studio in Context Assembly tool.
Edit a Part Studio within the context of an Assembly:
- In an Assembly, insert parts and position them as desired by adding mates and relations, or by using the triad manipulator.
- Right-click on a part to use as the reference point (primary instance) and select Edit in context from the context menu and then select the particular context in which to edit. (You also have the option to create a new context from this menu.)
The Part Studio containing the selected part opens with the entire Assembly visualized in a ghosted state.
- Make edits as desired, referencing faces, edges, or parts of the Assembly as needed. (Note that nothing automatically updates, you can manually update your Part Studio or Assembly when you want, see Update Context, below.)
Selecting a reference point on another part in the Assembly (aside from the primary instance) creates a Context object above the Feature list. You are able to use as many reference points as needed. (Selected reference points are highlighted in purple)
Be aware that you can repeat these steps and create many Contexts of an Assembly in the same Part Studio as well as switch between them, so be sure to rename the Context with a meaningful name.
- When finished editing, navigate back to the Assembly, in any of the following ways:
- Click Go to assembly at the top of the Graphics area.
- Select the Assembly tab at the bottom of the window.
- Right-click in the empty space and select Go to assembly.
Note the edits are visible in the Assembly.
- You are able to turn off a Context to make unrelated edits at any time by selecting None in the Assembly contexts list above the Feature list.
- Parts created without referencing the part being edited in-context are not automatically inserted into the Assembly.
- Best practice is to rename a Context immediately with a meaningful name; many Context objects can be created for a single Part Studio.
- Edit in context and select an existing Context when:
- You need to add additional geometric relationships
- You need to edit existing geometric relationships
To edit in context and select an existing Context: open the context menu, select the name of the existing Context you wish to edit and select "Edit in context."
Once you have created a Context, you can make changes either in the Part Studio or in the Assembly and choose to update that Context in the Part Studio if you wish. This enables you to work in a Context in the Part Studio and not affect your Assembly unless you want to update your Assembly with the changes. The same is true for changing the Context from within an Assembly. You can make changes to the Assembly, then switch to the Part Studio and update the Context there to view the changes if you wish. Updates are never applied automatically.
To update a Context in an Assembly: Select the part edited in context, right-click and select Update context and then the context you want to update:
To update a Context in a Part Studio: Select the Context in the Assembly context list, click and then Update context:
The original Context below was created with a straight purple blade:
The blade was then edited to have a curved edge:
In the Assembly, select Update context (of the limit plate) to update the shears with the curved blade. Since the limit plate was extruded up to the face of the blade, when updated, the limit plate is recalculated up the face of the new, curved blade:
Since it's possible to have multiple Contexts in one Part Studio, this example shows a Part Studio with two Contexts: one that references a ball valve in the closed position, and another that references the ball valve in the open position. A stop is modeled in each Context, so the final design has a stop for the open position and the closed position.
In the Part Studio, the ball valve in the closed position, in context:
In the Part Studio, the ball valve in the open position, in context:
The final design of the stop mechanism in the Part Studio:
The primary instance is created when you edit a part in-context and is indicated by a solid arrow beside the feature in the Feature list (in the Part Studio) and beside the part in the Instance list (in the Assembly). The primary instance defines the anchor part (the part selected for the Edit in context command) for the placement of the ghosted assembly in the Part Studio; all other assembly components appear in the Part Studio in relationship to that primary instance.
You have the ability to change the primary instance of a Context at any time and may wish to do so especially in the case of a broken or missing primary instance:
- In the Assembly, select a part.
- Right-click to access the menu, and select <context name> > Set as primary instance.
The new primary instance is marked with a solid arrow in the Parts list, and the previous primary instance (if present) is marked with a dashed arrow .
Context objects are given a default name when they are created. To avoid confusion, rename each Context with meaningful names as it is created.
In the Part Studio that contains the Context object:
- In the Assembly Contexts list (located above the Feature list), select the Context from the dropdown.
- Click the that becomes active when the Context name is selected.
- Select Rename.
- Type a new name and press Enter or click .
When working in one workspace and inserting a part from a version, when you select to Edit in context, the Select a workspace to edit dialog opens (since you cannot edit the part in an immutable version). This allows you to select the specific workspace in which to edit the part:
In the dialog, select the specific workspace (Main or B2, in this case) in which to edit in context.
Use this command when you want to end an edit in context session and return to the Part Studio without a Context and without creating a Context object.
While editing In-Context in the Part Studio:
Right-click either in the white graphics area, or on the part being edited and select Exit context or click the X in the gold banner at the top of the graphics area: