예제 #1
0
 /// <summary>
 /// Initialize string builder with initial sections + line types
 /// Instantiate DL_Dxf class and DL_Writer class
 /// </summary>
 /// <param name="factory"></param>
 public override void Initialize(PicFactory factory)
 {
     DL_Codes.dxfversion version = DL_Codes.dxfversion.AC1012;
     dw = new DL_Writer(version);
     dxf = new DL_Dxf();
     dxf.writeHeader(dw);
     dw.sectionEnd();
     // opening the table section
     dw.sectionTables();
     // writing viewports
     dxf.writeVPort(dw);
     // writing line types
     dw.tableLineTypes(25);
     dxf.writeLineType(dw, new DL_LineTypeData("BYBLOCK", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("BYLAYER", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("CONTINUOUS", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("ACAD_ISO02W100", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("ACAD_ISO03W100", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("ACAD_ISO04W100", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("ACAD_ISO05W100", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("BORDER", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("BORDER2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("BORDERX2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("CENTER", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("CENTER2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("CENTERX2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DASHDOT", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DASHDOT2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DASHDOTX2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DASHED", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DASHED2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DASHEDX2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DIVIDE", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DIVIDE2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DIVIDEX2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DOT", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DOT2", 0));
     dxf.writeLineType(dw, new DL_LineTypeData("DOTX2", 0));
     dw.tableEnd();
     // writing the layers
     int numberOfLayers = 3;
     dw.tableLayers(numberOfLayers);
     // CUT
     dxf.writeLayer(dw, new DL_LayerData("L5-113", 0),
         new DL_Attributes("",                       // leave empty
             (int)DL_Codes.dxfcolor.red,             // default color
             100,                                    // default width
             "CONTINUOUS"));                         // default line style
     // FOLD
     dxf.writeLayer(dw, new DL_LayerData("L8-123", 0),
         new DL_Attributes("",                       // leave empty
             (int)DL_Codes.dxfcolor.blue,            // default color
             100,                                    // default width
             "CONTINUOUS"));                         // default line style
     // COTATION
     dxf.writeLayer(dw, new DL_LayerData("LDM-4", 0),
         new DL_Attributes("",                       // leave empty
             (int)DL_Codes.dxfcolor.green,           // default color
             100,                                    // default width
             "CONTINUOUS"));                         // default line style
     dw.tableEnd();
     dw.sectionEnd();
     // write all entities
     dw.sectionEntities();
 }