<?xml encoding=”UTF-8″>by Chandra shekar Gopal,
Why Explore Model Hierarchies?
When working with Fusion designs, understanding the complete structure of your assemblies, components, and subcomponents is crucial for effective manufacturing data analysis, automation, and downstream workflows.
⚡ Important: This workflow retrieves your Fusion design’s Model Hierarchy directly from the cloud using the Manufacturing Data Model API, not by opening Fusion software on your machine. This ensures headless, scalable data extraction for your server, web, or pipeline integrations.
What this Sample Demonstrates
Using this sample application, you will:
- ✅ Authenticate using Autodesk APS (formerly Forge) OAuth 3.0
- ✅ Retrieve your design’s model hierarchy securely via the Manufacturing Data Model API
- ✅ Visualize assemblies, subassemblies, and references recursively without launching Fusion locally
- ✅ Gain deep insights into your Fusion design structure for analysis and automation
📂 Access the Source Code
You can find the full source code for this project on GitHub:
➡️ Retrieving Model Hierarchy of Fusion Design using Manufacturing Data Model API (GitHub)
🛠️ Setting Up Your Environment
1️⃣ Install Dependencies
Run in your Package Manager Console:
Install-Package Microsoft.AspNetCore.Authentication.Cookies
Install-Package Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation
Install-Package Microsoft.AspNetCore.Session
Install-Package Microsoft.Extensions.Http
Install-Package System.Text.Json
Install-Package GraphQL.Client
Install-Package GraphQL.Client.Serializer.SystemTextJson
2️⃣ Create and Configure Your APS App
- Create a new app on the APS Portal.
- Retrieve your ClientId and ClientSecret.
- Set the Callback URL to:
http://localhost:3000/callback/oauth⚠️ Ensure the callback URL in your app and code match exactly.
Example:

3️⃣ Add OAuth Credentials
Add to your appsettings.json:
{
"OAuth": {
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret",
"RedirectUri": "http://localhost:3000/callback/oauth",
"TokenUrl": "https://developer.api.autodesk.com/authentication/v2/token",
"Scopes": "data:read data:write data:create"
}
}
4️⃣ Run the Application
Start your server:
dotnet run
Navigate to:
http://localhost:3000
Log in using your Autodesk account to authorize the app.
🔍 Understanding the Workflow
This app uses a clean workflow to retrieve and explore your design data directly from the cloud:
- Authenticate securely with OAuth 3.0
- Navigate your Team Hub and projects
- Select Fusion Design Items or Basic Items (Inventor, Revit, Navisworks)
- View the hierarchy and structure of selected files
- Recursively retrieve full model hierarchies via the Manufacturing Data Model API (not Fusion software)
🚩 What is Displayed?
✅ DesignItem: Fusion design files (e.g., Utility Knife, Sheet Metal Example, Tutorial1)
✅ BasicItem: Other Autodesk products (Inventor, Revit, Navisworks, DWF)
🔗 The GraphQL Query
The app uses the following GraphQL query via the Manufacturing Data Model API to retrieve your model hierarchy:
query GetModelHierarchy($hubName: String!, $projectName: String!, $componentName: String!) {
hubs(filter: {name: $hubName}) {
results {
name
projects(filter: {name: $projectName}) {
results {
name
items(filter: {name: $componentName}) {
results {
... on DesignItem {
name
tipRootComponentVersion {
id
name
allOccurrences {
results {
parentComponentVersion {
id
}
componentVersion {
id
name
}
}
pagination {
cursor
}
}
}
}
}
}
}
}
}
}
}
✅ Retrieves the root component and references
✅ Recursively gathers child components and structure
✅ Does not require Fusion to run locally, enabling scalable, automated data retrieval
📝 Conclusion
Using this Manufacturing Data Model API sample, you can:
- ✅ Authenticate securely via APS OAuth
- ✅ Retrieve your model hierarchy efficiently without Fusion installed
- ✅ Visualize your design structure for analysis and automation
Once configured, you can seamlessly explore your Fusion design hierarchy, unlocking data-driven workflows for quoting, BOM generation, and automated documentation.

Leave a Reply