Skip to content
forked from DomCR/ACadSharp

C# library to read/write cad files like dxf/dwg.

License

Notifications You must be signed in to change notification settings

kelilive/ACadSharp

 
 

Repository files navigation

ACadSharp Build&Test License nuget

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 (limited to the version AC1018 - most stable)
  • Extract/Modify the geometric information from the different entities in the model
  • Control over the table elements like Blocks, Layers and Styles, allows you to read, create or modify the different tables

Compatible Dwg/Dxf versions:

DxfReader DxfWriter DwgReader DwgWriter
AC1009
AC1012 ✔️ ✔️
AC1014 ✔️ ✔️ ✔️ ✔️
AC1015 ✔️ ✔️ ✔️ ✔️
AC1018 ✔️ ✔️ ✔️ ✔️
AC1021 ✔️ ✔️ ✔️
AC1024 ✔️ ✔️ ✔️ ✔️
AC1027 ✔️ ✔️ ✔️
AC1032 ✔️ ✔️ ✔️ ✔️

Current development

Dwg Writer

  • AC1014 - Release 14, 14.01 (LT97/LT98)
    • Produces a valid file but some entities are missing in the model.
  • AC1015 - AutoCAD 2000/2000i/2002
    • This version depens on the implementation of VP_ENT_HDR to work properly with the different Viewports
  • AC1018 - AutoCAD 2004/2005/2006 - MOST STABLE - RECOMENDED
  • AC1021 - AutoCAD 2007/2008/2009 - NOT IMPLEMENTED
    • This is a particular and isolated DWG version, it uses a different compression system and file distribution, due this difficulties, this version will not be implemented any time soon.
  • AC1024 - AutoCAD 2010/2011/2012 - STABLE
  • AC1027 - AutoCAD 2013/2014/2015/2016/2017 - NOT IMPLEMENTED
  • AC1032 - AutoCAD 2018/2019/2020 - STABLE

IMPORTANT NOTE when you open a file writen by ACadSharp with Autocad the following message may appear: The drawing file requires recovery press on Recover and it will open the file normally. This process may cause a loss of information on the file.

Code Example

public static void Main()
{
	string path = "sample.dwg";
	CadDocument doc = DwgReader.Read(path, onNotification);
}

// Process a notification form the reader
private static void onNotification(object sender, NotificationEventArgs e)
{
	Console.WriteLine(e.Message);
}

For more examples check.

Contributing

Please feel free to fork this repo and send a pull request if you want to contribute to this project.

Notice that this project is in an alpha version, not all the features are implemented and there can be bugs due to this so any PR with a bug fix will not have a priority.

If you want to contribute you can check the Dxf documentation here.

License

This project is licensed under the MIT License - see the LICENSE file for details

About

C# library to read/write cad files like dxf/dwg.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%