Reassign a Model to a Shared Part Number
In the Manufacturing Data Model, a part number identifies a Component.
Multiple Model objects can therefore reference the same
Component by sharing its part number. When you assign a part number to
a model, one of two things happens:
- Create: If no component currently uses that part number in the hub, a new component is created for the model.
- Reassign: If a component already uses that part number, the model is
reassigned to point at that existing component. The model immediately
reflects that component’s
name,description,baseProperties, and other definition-level state - not because anything was copied, but becausemodel.componentnow resolves to a differentComponent.
This tutorial walks through the reassign path end-to-end so you can verify the behavior in your own data.
You will:
- Capture the model’s current component (the before state).
- Capture the source component whose part number you intend to assign.
- Assign that part number to the model with
assignModelPartNumber. - Re-query the model and confirm that
model.componentnow resolves to the source component, with itsnameandbaseProperties.
As a prerequisite for completing the current topic, you need to complete the following tasks:
For background on the underlying concepts, see the Shared Part Number developer guide.
You will use the following operations in this task:
| Type | Operation | Description |
|---|---|---|
| model | Query | Retrieves a model and the component it currently resolves to. |
| component | Query | Retrieves the source component whose part number you will assign. |
| assignModelPartNumber | Mutation | Assigns a part number to a model. |
What you’ll see at the end
After Step 4, three things change relative to Step 1:
model.component.idis different - it now matches the source component’s ID from Step 2.model.component.name.valuechanges from"A1"to"A".model.component.baseProperties.resultsgoes from empty to the source component’s properties (Stock Number,Manufacturer).
Step 1 - Get the model’s current component
The model query retrieves the component the model currently resolves to, along with that component’s part number and base properties. This is the before state.
- In Manufacturing Data Model Explorer, enter the following query in the Query pane:
Query:
query GetModelBefore($modelId: ID!) {
model(modelId: $modelId) {
id
component {
id
name { value }
partNumber { value }
baseProperties {
results {
displayValue
name
value
definition { id }
}
}
}
}
}
- In the Query Variables Pane, enter the value of
modelId.
Query Variables
{
"modelId": "bW9kZWx-MzdIYmo0R1ZBaG5FM1ZYVGRyajN4c19MMkN-NU5jaVJEanFNc2hOcllxbTFock1qel9hZ2"
}
- Click Play.
Response (before)
{
"data": {
"model": {
"id": "bW9kZWx-MzdIYmo0R1ZBaG5FM1ZYVGRyajN4c19MMkN-NU5jaVJEanFNc2hOcllxbTFock1qel9hZ2",
"component": {
"id": "cHJvZHVjdH53TTBJUmZ2ZzNPVUtMdmxiMnh0Mkx0X0wyQ35GMkJWR2xuUnZUY2VCZlExNWtVTkpVX2FnYQ",
"name": { "value": "A1" },
"partNumber": { "value": "2025-08-25-06-14-45-174" },
"baseProperties": { "results": [] }
}
}
}
}
Note the component.id and partNumber.value - you’ll compare them
in Step 4.
Step 2 - Get the source component to share
The component query retrieves the component whose part number you will assign in Step 3. This is the component the model will resolve to after the mutation.
- In Manufacturing Data Model Explorer, enter the following query in the Query pane:
Query:
query GetSourceComponent($componentId: ID!) {
component(componentId: $componentId) {
id
name { value }
partNumber { value }
baseProperties {
results {
displayValue
name
value
definition { id }
}
}
}
}
- In the Query Variables Pane, enter the value of
componentId.
Query Variables
{
"componentId": "cHJvZHVjdH4zN0hiajRHVkFobkUzVlhUZHJqM3hzX0wyQ35ZU2tZWXNNaDZnZGN5Y1JieW55QWYxX2FnYQ"
}
- Click Play.
Response
{
"data": {
"component": {
"id": "cHJvZHVjdH4zN0hiajRHVkFobkUzVlhUZHJqM3hzX0wyQ35ZU2tZWXNNaDZnZGN5Y1JieW55QWYxX2FnYQ",
"name": { "value": "A" },
"partNumber": { "value": "H12-001" },
"baseProperties": {
"results": [
{
"displayValue": "1",
"name": "Stock Number",
"value": "1",
"definition": {
"id": "cHJvcGRlZn5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflFtRnpaVkJ5YjNCbGNuUnBaWE5IY205MWNGTjBZV2RwYm1jflEyOXRjRzl1Wlc1MH5wYXJhbWV0ZXJzLlFtRnpaVkJ5YjNCbGNuUnBaWE5UZEdGbmFXNW46OGE5YTQwZWI2NDRmNGJiNzk5ZDJjOTc4NGU3ZDliMjUtMS4wLjA"
}
},
{
"displayValue": "Autodesk",
"name": "Manufacturer",
"value": "Autodesk",
"definition": {
"id": "cHJvcGRlZn5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflFtRnpaVkJ5YjNCbGNuUnBaWE5IY205MWNGTjBZV2RwYm1jflEyOXRjRzl1Wlc1MH5wYXJhbWV0ZXJzLlFtRnpaVkJ5YjNCbGNuUnBaWE5UZEdGbmFXNW46ZTM1NDM5ZTJlMDI0NDhjYTgyNWQ0MTI4MTY4NDJlY2ItMS4wLjA"
}
}
]
}
}
}
}
Take note of partNumber.value ("H12-001") - this is the value you
pass to the mutation in Step 3.
Step 3 - Assign the part number to the model
Use the
assignModelPartNumber
mutation with an
AssignPartNumberInput
input object. Pass the modelId from Step 1 and the partNumber
from Step 2. Because a component already exists for that part number,
the model is reassigned to that component.
The mutation response only confirms the new partNumber; you’ll re-run
the model query in Step 4 to see the full effect on
component.baseProperties.
- In Manufacturing Data Model Explorer, enter the following mutation in the Query pane:
Mutation:
mutation AssignPartNumber($input: AssignPartNumberInput!) {
assignModelPartNumber(input: $input) {
model {
id
component {
id
partNumber { value }
}
}
}
}
- In the Query Variables Pane, enter the value of
input.
Query Variables
{
"input": {
"modelId": "bW9kZWx-MzdIYmo0R1ZBaG5FM1ZYVGRyajN4c19MMkN-NU5jaVJEanFNc2hOcllxbTFock1qel9hZ2",
"partNumber": "H12-001",
"isConfigurationRuleIgnored": false
}
}
isConfigurationRuleIgnored defaults to false; pass true only
when you want the assignment to apply to this model alone and leave its
configuration siblings on their existing part numbers. See the
Shared Part Number
developer guide for guidance on when to use each setting.
- Click Play.
Response
{
"data": {
"assignModelPartNumber": {
"model": {
"id": "bW9kZWx-MzdIYmo0R1ZBaG5FM1ZYVGRyajN4c19MMkN-NU5jaVJEanFNc2hOcllxbTFock1qel9hZ2",
"component": {
"id": "cHJvZHVjdH4zN0hiajRHVkFobkUzVlhUZHJqM3hzX0wyQ35ZU2tZWXNNaDZnZGN5Y1JieW55QWYxX2FnYQ",
"partNumber": { "value": "H12-001" }
}
}
}
}
}
Notice that model.component.id already matches the source component’s
ID from Step 2. The model is now resolving to the same component.
Step 4 - Verify the model resolves to the source component
Re-run the query from Step 1 to confirm that model.component now
exposes the source component’s name and baseProperties.
- In Manufacturing Data Model Explorer, re-enter the following query in the Query pane:
Query:
query GetModelAfter($modelId: ID!) {
model(modelId: $modelId) {
id
component {
id
name { value }
partNumber { value }
baseProperties {
results {
displayValue
name
value
definition { id }
}
}
}
}
}
- In the Query Variables Pane, enter the value of
modelId.
Query Variables
{
"modelId": "bW9kZWx-MzdIYmo0R1ZBaG5FM1ZYVGRyajN4c19MMkN-NU5jaVJEanFNc2hOcllxbTFock1qel9hZ2"
}
- Click Play.
Response (after)
{
"data": {
"model": {
"id": "bW9kZWx-MzdIYmo0R1ZBaG5FM1ZYVGRyajN4c19MMkN-NU5jaVJEanFNc2hOcllxbTFock1qel9hZ2",
"component": {
"id": "cHJvZHVjdH4zN0hiajRHVkFobkUzVlhUZHJqM3hzX0wyQ35ZU2tZWXNNaDZnZGN5Y1JieW55QWYxX2FnYQ",
"name": { "value": "A" },
"partNumber": { "value": "H12-001" },
"baseProperties": {
"results": [
{
"displayValue": "1",
"name": "Stock Number",
"value": "1",
"definition": {
"id": "cHJvcGRlZn5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflFtRnpaVkJ5YjNCbGNuUnBaWE5IY205MWNGTjBZV2RwYm1jflEyOXRjRzl1Wlc1MH5wYXJhbWV0ZXJzLlFtRnpaVkJ5YjNCbGNuUnBaWE5UZEdGbmFXNW46OGE5YTQwZWI2NDRmNGJiNzk5ZDJjOTc4NGU3ZDliMjUtMS4wLjA"
}
},
{
"displayValue": "Autodesk",
"name": "Manufacturer",
"value": "Autodesk",
"definition": {
"id": "cHJvcGRlZn5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflFtRnpaVkJ5YjNCbGNuUnBaWE5IY205MWNGTjBZV2RwYm1jflEyOXRjRzl1Wlc1MH5wYXJhbWV0ZXJzLlFtRnpaVkJ5YjNCbGNuUnBaWE5UZEdGbmFXNW46ZTM1NDM5ZTJlMDI0NDhjYTgyNWQ0MTI4MTY4NDJlY2ItMS4wLjA"
}
}
]
}
}
}
}
}
What changed
Compare these fields between the Step 1 and Step 4 responses:
| Field | Before (Step 1) | After (Step 4) |
|---|---|---|
model.component.id |
...NUNciR... (original) |
...YSkY... (source) |
model.component.name.value |
"A1" |
"A" |
model.component.partNumber.value |
|
|
model.component.baseProperties.results |
[] |
2 properties from Step 2 |
The model.id did not change. The model now resolves to the same
Component as the source from Step 2, which is why every field under
component matches Step 2.
Notes
- Assigning a part number to a model either creates a new component (if no component uses that part number) or reassigns the model to the existing component for that part number. This tutorial demonstrates the reassignment path.
- The values under
basePropertiesare not copied during assignment. They are simply the properties of the component the model now resolves to. - To change which model represents a shared part number (for thumbnails, icons, and other representative features), use the setModelAsPrimary mutation.
- To inspect or modify the values shown under
basePropertiesonce the model has been reassigned, see the Retrieve and Update Base Properties tutorial.