https://github.com/domcr/acadsharp
C# library to read/write cad files like dxf/dwg.
https://github.com/domcr/acadsharp
cad dwg dwg-files dwg-reader dwg-writer dxf dxf-files dxf-reader dxf-writer
Last synced: about 2 months ago
JSON representation
C# library to read/write cad files like dxf/dwg.
- Host: GitHub
- URL: https://github.com/domcr/acadsharp
- Owner: DomCR
- License: mit
- Created: 2021-02-04T20:44:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2026-02-13T16:57:14.000Z (4 months ago)
- Last Synced: 2026-02-14T00:51:02.454Z (4 months ago)
- Topics: cad, dwg, dwg-files, dwg-reader, dwg-writer, dxf, dxf-files, dxf-reader, dxf-writer
- Language: C#
- Homepage:
- Size: 24 MB
- Stars: 664
- Watchers: 26
- Forks: 172
- Open Issues: 60
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
ACadSharp    [](https://coveralls.io/github/DomCR/ACadSharp?branch=master)
---
C# library to read/write cad files like dxf/dwg.
### Features
ACadSharp allows to read or create CAD files using .Net and also extract or modify existing content in the files, the main features may be listed as:
- Read/Write Dxf binary files
- Read/Write Dxf ASCII files
- Read Dwg files
- Write Dwg files
- Extract/Modify the geometric information from the different [entities](https://help.autodesk.com/view/OARX/2021/ENU/?guid=GUID-7D07C886-FD1D-4A0C-A7AB-B4D21F18E484) in the model
- Control over the table elements like Blocks, Layers and Styles, allows you to read, create or modify the different tables
For pdf export check :construction: [ACadSharp.Pdf](https://github.com/DomCR/ACadSharp.Pdf) :construction:.
#### Compatible Dwg/Dxf versions:
| | DxfReader | DxfWriter | DwgReader | DwgWriter |
------ | :-------: | :-------: | :-------: | :-------: |
AC1009 | :heavy_check_mark: | :x: | :x: | :x: |
AC1012 | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: |
AC1014 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
AC1015 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
AC1018 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
AC1021 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
AC1024 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
AC1027 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
AC1032 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
Code Example
---
```c#
public static void Main()
{
string path = "sample.dwg";
CadDocument doc = DwgReader.Read(path, onNotification);
}
// Process a notification from the reader
private static void onNotification(object sender, NotificationEventArgs e)
{
Console.WriteLine(e.Message);
}
```
For more code examples [check](https://github.com/DomCR/ACadSharp/tree/master/src/ACadSharp.Examples).
Visit the :construction: [wiki](https://github.com/DomCR/ACadSharp/wiki) :construction: for the API specification of the library.
Check the [documentation](https://github.com/DomCR/ACadSharp/tree/master/docs/) for specific information about some use cases.
Building
---
Before building run:
```console
git submodule update --init --recursive
```
This command will clone the submodules necessary to build the project.