An AutoCAD plugin demonstrating the integration of native C++ with .NET 8.0 using C++/CLI.
This sample showcases best practices for AutoCAD plugin development, including proper memory management, thread safety, and modern UI design.
Demo.mp4
- Custom smart pointer implementation for AutoCAD database objects
- Thread-safe database operations
- Modern Windows Forms UI with async operations
- Professional error handling and user feedback
- RAII pattern for resource management
- Modeless dialog integration with AutoCAD
- AutoCAD 2025 or later
- ObjectARX SDK 2025
- Windows 10 or later
- .NET 8.0 or later
- Visual Studio 2022 17.8 and later
├── StdAfx.h # AutoCAD and System .NET references
├── ArxNetCore.cpp # Windows DLL entry point
├── acrxEntryPoint.cpp # ObjectARX entry point and command definition
└── Resource.h # Resource definitionsgit clone
cd ArxNetCore
set ArxSdkDir = D:\ArxSdks\arx2025
msbuild /t:build /p:Configuration=Debug;Platform=x64
-
After cloning the repository, open the
ArxNetCore.slnsolution in Visual Studio 2022. -
Open the Property Manager:
- Go to the View menu at the top of the window.
- Select Other Windows.
- Click on Property Manager.
Alternatively, you can use the keyboard shortcut
Ctrl + Shift + F7to open the Property Manager window directly. -
In the Property Manager, expand
Debug|x64and double-click on theObjectARX 2025property page. -
Navigate to Common Properties → User Macros.
-
Edit the
ArxSdkDirvalue to point to your ObjectARX SDK path. -
Save, click OK, and close the Property Manager.
-
Build the project.
-
Launch AutoCAD 2025 (or later).
-
In AutoCAD, load the plugin:
netload ~x64\Debug\MADArxNetCore.dll -
Run the command:
LAUNCHTOOL -
Enter the desired circle raidus.
-
Click
Draw Circleto create circle in current drawing. -
Enjoy using the plugin! 🙂
Provides thread-safe database operations and memory management through:
- Smart pointer implementation
- RAII pattern
- Factory methods for entity creation
Windows Forms dialog featuring:
- Asynchronous operations
- User input validation
- Simple UI design
- Proper error handling
- Clean command registration
- Exception handling
- Resource management
- Memory Management:
- Smart pointers for AutoCAD objects
- Proper cleanup of resources
- Prevention of memory leaks
- Thread Safety:
- Main thread execution for AutoCAD commands
- Async operations for UI responsiveness
- Proper synchronization
- Error Handling:
- Comprehensive exception management
- User-friendly error messages
- Proper cleanup on errors
This project is licensed under the MIT License - see the LICENSE file for details.
Madhukar Moogala
Developer Advocate @ Autodesk Platform Services