Skip to content

Manufacturing Data Model API Samples:Samples to show how you can use the Manufacturing Data Model API

License

Notifications You must be signed in to change notification settings

autodesk-platform-services/aps-fusion-data-samples

Repository files navigation

Manufacturing Data Model API Samples

Platforms License

APS API: oAuth2 Manufacturing Data Model API


This repository contains several samples illustrating use of Manufacturing Data Model API in context of various workflows:

  1. 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.
  2. 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.
  3. 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.

Prerequisites

  1. APS Account: Learn how to create a APS Account, activate subscription and create an app at this tutorial;
  2. Node.Js with version > v16.13.2 and basic knowledge of JavaScript;

Notes

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.

thumbnail

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

Query

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"
    }
  }
}

License

These samples are licensed under the terms of the MIT License. Please see the LICENSE file for full details.

Written by

Adam Nagy [email protected], Autodesk Partner Development

Denis Grigor [email protected], Autodesk Partner Development

About

Manufacturing Data Model API Samples:Samples to show how you can use the Manufacturing Data Model API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published