OCR2Geometry for AutoCAD is a lightweight AutoCAD plugin that converts coordinate tables from images into drawing geometry.
The first target is AutoCAD 2020, using C# / .NET Framework / WPF.
- Recognize planar coordinate tables from images
- Work with X/Y coordinates only
- Swap X and Y columns
- Review and edit recognized values before import
- Create AutoCAD
DBPointobjects - Add point-number
DBTextlabels next to points - Export recognized coordinates to CSV
No latitude/longitude or coordinate-system transformation is planned for the first MVP.
The bootstrap build already contains:
- AutoCAD plugin entry point
OCR2GEOMETRYcommand- WPF plugin window
- test coordinate model
- creation of
DBPointobjects in Model Space - creation of point-number
DBTextlabels
Test coordinates currently used by the bootstrap build:
1 512345.23 6876543.11
2 512351.86 6876551.42
3 512360.14 6876567.30
- Windows
- AutoCAD 2020 installed
- Visual Studio 2022 with .NET desktop development tools
- .NET Framework 4.7.2 targeting pack
The project expects the AutoCAD managed API assemblies in the default installation directory:
C:\Program Files\Autodesk\AutoCAD 2020\acdbmgd.dll
C:\Program Files\Autodesk\AutoCAD 2020\acmgd.dll
C:\Program Files\Autodesk\AutoCAD 2020\accoremgd.dll
If AutoCAD is installed elsewhere, set the MSBuild property Acad2020Dir to the correct folder.
AutoCAD references use Copy Local = False so Autodesk DLLs are not copied into the plugin output or repository.
- Open
OCR2Geometry.slnin Visual Studio. - Build the solution in
DebugorReleasemode. - Start AutoCAD 2020.
- Run:
NETLOAD
- Select the built
OCR2Geometry.dll, normally from:
src\OCR2Geometry\bin\Debug\OCR2Geometry.dll
- Run:
OCR2GEOMETRY
- Click Create test points.
The bootstrap build should create three points and their point numbers in Model Space.
- Plugin project
-
OCR2GEOMETRYcommand - WPF window
- Test point creation
- Point numbering labels
- Editable coordinate grid
- Add/delete rows
- Start-number setting
- Text height and text offset settings
- X/Y swap
- Export recognized/edited table to CSV
- Image selection
- OCR engine integration
- Coordinate table parser
- Recognition confidence / validation workflow
OCR2Geometry-for-AutoCAD/
├── OCR2Geometry.sln
├── src/
│ └── OCR2Geometry/
│ ├── AutoCAD/
│ ├── Commands/
│ ├── Models/
│ ├── Properties/
│ ├── UI/
│ └── OCR2Geometry.csproj
└── README.md
Early development. The current branch is intended to prove the AutoCAD 2020 plugin loading and geometry-writing workflow before OCR is added.