This is a sample console connector that demonstrates how to use the Autodesk Data Exchange SDK without the UI component. It serves as a reference implementation for developers building their own Data Exchange integrations and provides a comprehensive example of SDK capabilities through a professional command-line interface.
Perfect for:
- Service-based integrations
- Custom UI development
- Learning Data Exchange SDK patterns
- Automated workflow testing
- Headless data processing
- π Quick Start - Get up and running quickly
- π» Usage Examples - See the console connector in action
- π Command Reference - Complete command documentation
- π Migration Guide - SDK 6.3.0 Upgrade Guide
- ποΈ Architecture - Understand the codebase structure
- π§ Extending the Application - Add custom functionality
- β Exchange Management - Create, update, and retrieve exchanges
- β Multi-Format Geometry Processing - BREP, IFC, Mesh, and Primitive geometries
- β Parameter Operations - Add, modify, and delete instance/type parameters
- β Version Control - Exchange synchronization and versioning
- β Data Export - Download exchanges as STEP or OBJ files
- β Folder Management - Set and manage working directories
- π Professional Console Interface - Clean, categorized output messages
- π Comprehensive Workflow Testing - Complete end-to-end validation
- π» Command-Based Architecture - Extensible command pattern
- π§ Error Handling - Robust error management and user feedback
- π Built-in Help System - Detailed command documentation
-
Autodesk Platform Services App
- Register an app
- Select Data Management and Data Exchange APIs
- Note your Client ID, Client Secret, and Auth Callback
-
Development Environment
- Visual Studio 2019 or later
- .NET Framework 4.8
- Basic knowledge of C#
-
Access Requirements
- Autodesk Construction Cloud (ACC) access
- Valid Autodesk account with appropriate permissions
git clone https://github.com/your-repo/aps-dataexchange-console.git
cd aps-dataexchange-consoleFollow the Data Exchange .NET SDK installation guide:
Option A: Visual Studio
- Open
ConsoleConnector.sln - Build the solution (packages restore automatically)
Option B: Command Line
# Run from project root
BuildSolution.batUpdate src/ConsoleConnector/App.config with your app credentials:
<appSettings>
<add key="APS_CLIENT_ID" value="your_client_id" />
<add key="APS_CLIENT_SECRET" value="your_client_secret" />
<add key="APS_CALLBACK_URL" value="your_callback_url" />
</appSettings>- Build and run the console application
- Complete OAuth authentication in the browser
- Start using commands in the console interface
# Get help
>> help
# Set working folder (using folder URL)
>> SetFolder [FolderUrl]
# OR set working folder (using individual parameters)
>> SetFolder [HubId] [Region] [ProjectUrn] [FolderUrn]
# Create a new exchange
>> CreateExchange [ExchangeTitle]
# Add BREP geometry
>> AddBrep [ExchangeTitle]
# Add instance parameters
>> AddInstanceParameter [ExchangeTitle] [ElementId] [ParameterName] [ParameterSchema] [ParameterValue] [ParameterValueDataType]
# Sync changes
>> SyncExchange [ExchangeTitle]
# Download exchange
>> GetExchange [ExchangeId] [CollectionId] [HubId] [ExchangeFileFormat]# Run comprehensive end-to-end test
>> WorkFlowTestThis command executes a complete workflow that:
- Creates a new exchange
- Adds multiple geometry types (BREP, IFC, Mesh, Primitives)
- Adds instance and type parameters
- Syncs to Version 1
- Deletes some parameters
- Adds more geometries and parameters
- Syncs to Version 2
- Downloads the final exchange
| Command | Description | Example |
|---|---|---|
help |
Display all commands | help |
help [command] |
Get command details | help CreateExchange |
CreateExchange |
Create new exchange | CreateExchange [ExchangeTitle] |
AddBrep |
Add BREP geometry | AddBrep [ExchangeTitle] |
AddIFC |
Add IFC geometry | AddIFC [ExchangeTitle] |
AddMesh |
Add mesh geometry | AddMesh [ExchangeTitle] |
AddPrimitive |
Add primitives | AddPrimitive [ExchangeTitle] [PrimitiveGeometry] |
AddInstanceParameter |
Add instance parameter | AddInstanceParameter [ExchangeTitle] [ElementId] [ParameterName] [ParameterSchema] [ParameterValue] [ParameterValueDataType] |
AddTypeParameter |
Add type parameter | AddTypeParameter [ExchangeTitle] [ElementId] [ParameterName] [ParameterSchema] [ParameterValue] [ParameterValueDataType] |
DeleteInstanceParam |
Remove instance parameter | DeleteInstanceParam [ExchangeTitle] [ElementId] [ParameterName] |
DeleteTypeParam |
Remove type parameter | DeleteTypeParam [ExchangeTitle] [ElementId] [ParameterName] |
SyncExchange |
Sync exchange | SyncExchange [ExchangeTitle] |
GetExchange |
Download exchange | GetExchange [ExchangeId] [CollectionId] [HubId] [ExchangeFileFormat] |
SetFolder |
Set working folder | SetFolder [FolderUrl] or SetFolder [HubId] [Region] [ProjectUrn] [FolderUrn] |
WorkFlowTest |
Run complete test | WorkFlowTest |
Exit |
Close application | Exit |
ConsoleConnector/
βββ Commands/ # Command implementations
β βββ CreateExchangeCommand.cs
β βββ CreateBrepCommand.cs
β βββ WorkFlowTestCommand.cs
β βββ ...
βββ Helper/ # Utility classes
β βββ ConsoleAppHelper.cs
β βββ GeometryHelper.cs
β βββ ParameterHelper.cs
βββ Interfaces/ # Abstractions
βββ Assets/ # Sample geometry files
- Command Pattern: Each operation is implemented as a separate command class
- Helper Classes: Reusable utilities for geometry, parameters, and console operations
- Interface Abstractions: Clean separation of concerns
- Asset Management: Sample files for testing and demonstration
- Create a new command class inheriting from
Command - Implement required methods (
Execute,Clone,ValidateOptions) - Register the command in
ConsoleAppHelper
public class MyCustomCommand : Command
{
public override async Task<bool> Execute()
{
Console.WriteLine("[CUSTOM] Executing my command");
// Implementation here
return true;
}
public override Command Clone()
{
return new MyCustomCommand(this);
}
}- Create option class in
Commands/Options/ - Add to command's
Optionslist - Use
GetOption<T>()to access values
This section documents the migration from SDK 6.2.0 to Autodesk Data Exchange SDK 6.3.0.
This upgrade includes important API improvements and refinements:
- SDK Version: Upgraded to
Autodesk.DataExchange 6.3.0 - Enhanced API Methods: Refined method signatures for better type safety
- API Cleanup: Removed deprecated classes and streamlined geometry handling
| Package | Previous Version | New Version | Impact |
|---|---|---|---|
Autodesk.DataExchange |
6.2.0 |
6.3.0 |
Major - Core SDK upgrade with API refinements |
Before (SDK 6.2.0):
// Color values were float from 0.0 to 1.0
MeshAPI.Color(0.5f, 0.75f, 1.0f, 1.0f); // RGBA as floatsAfter (SDK 6.3.0):
// Color values are now int from 0 to 255
MeshAPI.Color(127, 191, 255, 255); // RGBA as integersMigration Action: Convert all MeshAPI.Color() calls from float values (0.0-1.0) to integer values (0-255). Multiply your float values by 255 and cast to int.
Before (SDK 6.2.0):
// CurveSet class was available for curve operations
CurveSet curveSet = new CurveSet();
// ... curve operationsAfter (SDK 6.3.0):
// CurveSet has been removed - use GeometryContainer instead
GeometryContainer geometryContainer = new GeometryContainer();
// ... geometry operationsMigration Action: Replace all CurveSet usage with GeometryContainer. Update your curve handling logic to use the GeometryContainer API.
Update your packages.config or project file:
<package id="Autodesk.DataExchange" version="6.3.0" targetFramework="net48" />Search and replace all MeshAPI.Color() calls to use integer values:
// OLD: Float values (0.0 - 1.0)
MeshAPI.Color(0.5f, 0.75f, 1.0f, 1.0f);
// NEW: Integer values (0 - 255)
MeshAPI.Color(127, 191, 255, 255);
// Conversion formula: intValue = (int)(floatValue * 255)Search for all CurveSet usage and replace with GeometryContainer:
// OLD: Using CurveSet
CurveSet curveSet = new CurveSet();
// curve operations...
// NEW: Using GeometryContainer
GeometryContainer geometryContainer = new GeometryContainer();
// geometry operations...Run your application and verify that all geometry rendering and curve operations work correctly with the new APIs.
- Integer-based color values provide more intuitive and precise color control
- Clearer API contracts with strongly-typed parameters
- Reduced ambiguity in color value ranges
- Unified geometry handling through
GeometryContainer - Simplified API surface with removal of deprecated classes
- More consistent geometry operation patterns
- Optimized color processing with integer operations
- Improved memory efficiency in geometry operations
- Better API consistency across the SDK
After migration, run the comprehensive workflow test:
>> WorkFlowTestThis command validates:
- β Exchange creation and management
- β Geometry processing (BREP, IFC, Mesh, Primitives)
- β Parameter operations
- β Synchronization workflows
- β File download capabilities
- Color Operations: Integer-based colors are more efficient than float-based calculations
- Geometry Container: The unified
GeometryContainerprovides better memory management - Async/Await: Ensure all async methods are properly awaited
- API Simplification: Streamlined API reduces overhead and improves performance
Error: ArgumentException: Cannot convert float to int
Solution: Update all MeshAPI.Color() calls to use integer values (0-255) instead of float values (0.0-1.0). Use the conversion formula: (int)(floatValue * 255).
Error: Type or namespace 'CurveSet' could not be found
Solution: Replace all CurveSet references with GeometryContainer. Update your curve handling logic to use the new API.
Error: Colors appear different after migration Solution: Verify your color conversion is correct. Ensure you're multiplying float values by 255 and not accidentally dividing or using incorrect conversions.
Error: Assembly binding conflicts Solution: Clean and rebuild solution, ensure all packages are updated to 6.3.0 consistently.
- Breaking Changes: See above migration steps
- New Features: Explore the enhanced API documentation
- Performance: Review the optimization guidelines
- Issues: Report SDK-specific issues through official channels
Migration Checklist:
- Updated all package references to 6.3.0
- Converted all
MeshAPI.Color()calls to use integer values (0-255) - Replaced all
CurveSetusage withGeometryContainer - Tested mesh rendering with new color values
- Verified geometry operations with
GeometryContainer - Tested core workflows with
WorkFlowTest - Reviewed and updated error handling
This is a sample project for reference purposes. While direct contributions may not be accepted, you're encouraged to:
- Fork the repository for your own modifications
- Report issues or suggestions
- Share improvements with the community
This sample code is part of the Autodesk Data Exchange .NET SDK (Software Development Kit) beta. It is subject to the license covering the Autodesk Data Exchange .NET SDK (Software Development Kit) beta.
Dhiraj Lotake - Autodesk
Hariom Sharma - Autodesk
For SDK-related questions and support:
This sample demonstrates the power and flexibility of the Autodesk Data Exchange SDK for building custom integrations and automating design data workflows.