CAD .NET一款在CAD领域被广泛应用的控件,可以快速准确的阅读DWG和DXF文件,并且通过Windows GDI+方法绘制件,支持多种文件格式,包括DWG、DXF、Gerber、光栅图像等,并支持部分编辑功能。
CAD .NET本身就是一款快捷方便的CAD文档浏览转换控件,为了让大家更快上手使用,小编为大家整理了CAD .NET基础操作指南,希望对大家有所帮助。
有兴趣下载尝试CAD .NET v14最新版吗?
-
读取DWG文件
using CADImport; using CADImport.DWG; using CADImport.DXF; using CADImport.RasterImage;
private void Read_DWG_Click(object sender, EventArgs e) { //DWGImage class is used only for reading DWG. To read other formatsuse the corresponding classes. //E.g. for DXF: CADImage class, for PLT/HPGL: HPGLImage class. DWGImage vDrawing = new DWGImage(); vDrawing.LoadFromFile(@"..\..\..\Files\Gasket.dwg"); vDrawing.Draw(Image1.CreateGraphics(), new RectangleF(0, 0, (float)vDrawing.AbsWidth, (float)vDrawing.AbsHeight)); // zooming and panning of the drawing are implemented in the demo Viewer // via a special viewing control class CADPictureBox } -
加载文档
using CADImport; using CADImport.DWG; using CADImport.DXF; using CADImport.RasterImage;
private void Load_file_Click(object sender, EventArgs e) { if ((OpenFileDialog1.ShowDialog() != DialogResult.OK)) return; //CADImage.CreateImageByExtension detects format by the extension specified in the argument. //The correct class for any supported format will be used automatically. We recommend to //create a new drawing object with CADImage.CreateImageByExtension if import from the existed //file/stream is required. CADImage vDrawing = CADImage.CreateImageByExtension(OpenFileDialog1.FileName); vDrawing.LoadFromFile(OpenFileDialog1.FileName); // adjusting of the v
CAD .NET基础操作指南:DWG/DXF文件读取与转换

本文档介绍了CAD .NET控件的基础操作,包括如何使用.NET进行DWG文件的读取、文档加载、线条数据存取、图层管理和转换为BMP格式。示例代码详细展示了各项功能的实现,帮助开发者快速上手CAD .NET。
最低0.47元/天 解锁文章
1178

被折叠的 条评论
为什么被折叠?



