File tree Expand file tree Collapse file tree 2 files changed +34
-45
lines changed
Expand file tree Collapse file tree 2 files changed +34
-45
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- using ACadSharp . Examples . Common ;
1+ using ACadSharp . Entities ;
2+ using ACadSharp . Examples . Common ;
23using ACadSharp . IO ;
4+ using System . Collections . Generic ;
35
46namespace ACadSharp . Examples
57{
@@ -30,5 +32,36 @@ public static void ReadDwg(string file)
3032 CadDocument doc = reader . Read ( ) ;
3133 }
3234 }
35+
36+ /// <summary>
37+ /// Read the entities section from a dxf file and add them to a <see cref="CadDocument"/>
38+ /// </summary>
39+ /// <param name="file"></param>
40+ public static void ReadEntitiesFromDxf ( string file )
41+ {
42+ CadDocument doc = new CadDocument ( ) ;
43+ List < Entity > entities = new List < Entity > ( ) ;
44+
45+ using ( DxfReader reader = new DxfReader ( file ) )
46+ {
47+ reader . OnNotification += NotificationHelper . LogConsoleNotification ;
48+ entities = reader . ReadEntities ( ) ;
49+ }
50+
51+ doc . Entities . AddRange ( entities ) ;
52+ }
53+
54+ /// <summary>
55+ /// Read the tables section from a dxf file.
56+ /// </summary>
57+ /// <param name="file"></param>
58+ public static void ReadTablesFromDxf ( string file )
59+ {
60+ using ( DxfReader reader = new DxfReader ( file ) )
61+ {
62+ reader . OnNotification += NotificationHelper . LogConsoleNotification ;
63+ CadDocument doc = reader . ReadTables ( ) ;
64+ }
65+ }
3366 }
3467}
You can’t perform that action at this time.
0 commit comments