Overview of Our Client

Our client worked with AutoCAD drawings that had to be manually prepared before being sent to manufacturing equipment. This process required an operator to combine separate drawing primitives into contours, approximate curves, and check radii and angles against machine-specific technical constraints.

The client needed a native AutoCAD extension that would automate this preparation process and turn it into a single AutoCAD command, with configurable parameters managed through an INI file.

  • Region: Europe
  • Industry: Manufacturing / CAD & Industrial Automation
  • Timeline: ~1 month

Challenge

The main challenge was to build a native AutoCAD extension that could automate complex drawing geometry preparation while remaining accurate, configurable, and compatible with several AutoCAD versions.

  • Combining native and managed technologies. The plugin had to unite an ObjectARX/C++20 processing core with a C#/.NET user interface, including Ribbon controls, a context menu, and a floating palette.
  • Supporting multiple AutoCAD versions. The solution had to work with AutoCAD 2021-2025, each requiring a separate ObjectARX SDK, while keeping one shared codebase.
  • Reconstructing contours from separate primitives. The plugin needed to turn independent Line, Arc, Polyline, and Spline entities into connected contours without explicit adjacency data.
  • Meeting manufacturing geometry constraints. The processed geometry had to comply with equipment-specific limits, including chordal error, minimum arc radius, and cuspid angle requirements.

Our Approach

We structured the development process as a sequence of independent infrastructure and algorithmic layers, each of which could be tested and refined separately. The native ObjectARX component handled AutoCAD commands and direct interaction with drawings, a separate C++ library contained geometry processing and configuration logic, a C++/CLI bridge enabled communication between native and managed code, and the interface was implemented in C#/.NET.

This approach allowed us to isolate critical business logic from AutoCAD-specific dependencies, cover it with unit tests without launching AutoCAD, and keep the UI logic in managed code. For supporting tasks such as INI file parsing, path handling, coordinate comparison, and error processing, we used lightweight custom solutions to keep the plugin predictable, compact, and easy to maintain.

Solution

SCAND developed a native ObjectARX plugin for AutoCAD as a layered solution that combines a high-performance C++ geometry processing core with a managed C#/.NET interface. The plugin loads directly into AutoCAD, adds a custom Ribbon tab, context menu, and floating WPF palette, and registers a command that processes selected drawing primitives, filters them by layer and length, reconstructs contours, simplifies geometry, approximates curves with arcs, and outputs the optimized result to a separate PROCESSED layer.

Key Features

  • Hybrid C++/C# architecture: The plugin combines a native ObjectARX/C++20 core with a C#/.NET interface through a C++/CLI bridge.
  • AutoCAD primitive processing: The solution works directly with Line, Arc, Polyline, and Spline entities inside AutoCAD and filters objects according to defined rules.
  • Contour reconstruction: The plugin converts separate primitives into connected contours by analyzing object start and end points.
  • Geometry simplification: The Douglas-Peucker algorithm reduces contour complexity while keeping deviations within the allowed chordal error.
  • Arc approximation: Processed contours are converted into arcs with respect to minimum radius and segment closure angle requirements.
  • INI-based configuration: Manufacturing parameters can be adjusted without changing the plugin code.
  • AutoCAD-integrated interface: Users work with the plugin through a Ribbon tab, context menu, and floating WPF palette.
  • Testable C++ logic: Geometry and configuration logic is isolated in a separate library and covered with unit tests.

Screenshots

Ribbon
Context menu
Settings
Splines1
Splines2
Splines3
Splines4
Console

Technology Stack

Language and Platform

  • C++20
  • C# (.NET)
  • ObjectARX SDK 2021–2025
  • Visual Studio 2022

AutoCAD API

  • AcDbDatabase
  • AcDbLine / Arc / Polyline / Spline
  • acedRegCmds
  • AcApDocManagerReactor
  • acedGetCurrentSelectionSet

C++/.NET Interop

  • C++/CLI assembly as a C bridge
  • LoadLibrary + GetProcAddress for dynamic loading

UI (.NET)

  • Autodesk.Windows.Ribbon
  • PaletteSet
  • ContextMenuExtension
  • WPF via ElementHost

Geometry

  • Contour reconstruction through a hash table based on point codes
  • Douglas–Peucker algorithm
  • arc approximation with three points + least squares method

Algorithms

  • Two-pass chain building for open and closed contours
  • cuspid angle detection
  • smoothing with a minimum-radius arc

C++ Standard Library

  • std::filesystem
  • std::format
  • std::ranges
  • unordered_map/set
  • reference_wrapper
  • optional
  • unique_ptr

Configuration

  • Custom INI parser
  • type-safe template-based read/write methods
  • round-trip tests

Testing

  • Visual Studio CppUnitTestFramework
  • round-trip and negative parsing scenarios

Build

  • MSBuild
  • .props files for different AutoCAD versions

Result

As a result, the client received a native AutoCAD plugin that automates drawing geometry preparation and helps adapt selected primitives to the technical requirements of manufacturing equipment.

  • A native ObjectARX plugin compatible with AutoCAD 2021-2025.
  • A hybrid C++/C# architecture with a separate processing core and managed UI.
  • A custom Ribbon tab, context menu, and floating WPF palette inside AutoCAD.
  • Automated processing of Line, Arc, Polyline, and Spline entities.
  • Contour reconstruction, geometry simplification, arc approximation, and cuspid angle smoothing.
  • INI-based configuration for adjusting processing rules without code changes.
  • Testable geometry and configuration logic isolated in a separate C++ library.
  • Optimized output generated on a dedicated PROCESSED layer for manufacturing use.

Get in Touch with Us

Please enter your name.
Please enter a subject.
Please enter a message.
Please agree to our Terms and Conditions and the Privacy Policy.

This site uses technical cookies and allows the sending of 'third-party' cookies. By continuing to browse, you accept the use of cookies. For more information, see our Privacy Policy.