This repository contains several samples illustrating use of Manufacturing Data Model API in context of various workflows:
-
Read the Complete Model Hierarchy of a Design
- based on the path to a model (hub name, project name and file name) you can get the full model hierarchy - similar to what is shown inside Fusion 360.
-
Know when a Milestone is Available
- subscribe to the
milestone.created
event of a specific model in order to be notified when a milestone is created for a given version of it.
- subscribe to the
-
Find the Thumbnail of a specific Part
- based on the path to a model (hub name, project name and file name) you can get the thumbnail of a given model.
- APS Account: Learn how to create a APS Account, activate subscription and create an app at this tutorial;
- Node.Js with version > v16.13.2 and basic knowledge of JavaScript;
Though the samples start with the hubs(){}
query, there are many other options for you. The easiest is to check the QUERIES section on the DOCS tab in the Data Explorer sample to see what other starting points are available.
As you can see, you could e.g. start directly with a given file version if you already know the parameters it requires: hubId
, projectId
and versionId
. Perhaps you already have the necessary values from a previous GraphQL request or via the Data Management API
In that case the query might look like this:
{
fileVersion(
hubId: "a.YnVzaW5lc3M6YXV0b2Rlc2s2MTA0",
projectId: "a.YnVzaW5lc3M6YXV0b2Rlc2s2MTA0IzIwMjIwMjA0NDkzNjczNjA2",
versionId: "urn:adsk.wipprod:fs.file:vf.0pdKmY_sTHW957H5fthyLw?version=5"
) {
... on DesignFileVersion {
id
rootComponent {
name
}
}
}
}
and the reply could be:
{
"data": {
"fileVersion": {
"id": "urn:adsk.wipprod:fs.file:vf.0pdKmY_sTHW957H5fthyLw?version=5",
"rootComponent": {
"name": "Box"
}
}
}
}
You could also get to a specific folder or file using the item(){}
query if you know the id of the specific file or folder, e.g.:
{
item(
hubId: "a.YnVzaW5lc3M6YXV0b2Rlc2s2MTA0",
projectId: "a.YnVzaW5lc3M6YXV0b2Rlc2s2MTA0IzIwMjIwMjA0NDkzNjczNjA2",
itemId: "urn:adsk.wipprod:fs.folder:co.SC8l0gh1RKa_MkpcNCYExw"
) {
... on Folder {
name
}
}
}
and the reply could be:
{
"data": {
"item": {
"name": "Test folder"
}
}
}
These samples are licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Adam Nagy [email protected], Autodesk Partner Development
Denis Grigor [email protected], Autodesk Partner Development