This solution provides an ASP.NET Core Web API for processing DWG files using Autodesk RealDWG in a decoupled job queue model.
Build.sln
├── DWGExtractor/ # DWG parsing logic (runs RealDWG)
├── DWGLib/ # Shared library (optional usage)
├── WebApi/ # ASP.NET Core Web API
│ ├── Controllers/ # API controllers
│ ├── Services/ # IJobQueue, DrawingProcessor
│ ├── Models/ # DrawingJob, Response Models
├── WebApi.Tests/ # xUnit Test Project
-
Get the
Autodesk RealDWG SDKfrom [Techsoft3d](Autodesk RealDWG | Tech Soft 3D) vendor, they are the only RealDWG resellers of Autodesk. -
Set REALDWGSDK= <Path of RealDWG SDK>- example
SET REALDWGSDK=D:\RD25\RealDWG 2025\
- example
-
Download .NET 8.0
-
Download Visual Studio 2019 or 2022 any version, community edition also works.
dotnet test WebApi.Tests/WebApi.Tests.csprojdotnet run --project WebApi/WebApi.csprojPOST /upload– Uploads a DWG file for processing.GET /status/{id}– Get status of a processing job.GET /result/{id}– Get parsed layer/block results from DWG file.
- Uploaded file creates a
DrawingJobin anInMemoryJobQueue. - Background processor triggers DWGExtractor as a subprocess.
- Output is parsed into text and returned via
/result.
The API is load tested using K6, a modern load testing tool. Here's an example test script:
There are other scripts for various scenaros at .\LoadTesting folder.
import http from 'k6/http';
import { check, sleep } from 'k6';
export default function () {
const file = open('./sample.dwg', 'b');
const data = {
file: http.file(file, 'sample.dwg')
};
const res = http.post('http://localhost:5000/api/drawings/upload', data);
check(res, {
'upload successful': (r) => r.status === 200,
});
sleep(1);
}k6 run loadTest.jsThis script uploads a DWG file and checks the response for correctness. You can expand it to chain calls to /status and /result.
This sample is licensed under the terms of the MIT License. Please see the [LICENSE](ReadDWG/LICENSE at master · MadhukarMoogala/ReadDWG · GitHub) file for full details.
Madhukar Moogala, Autodesk Platform Services @galakar