Beispiel #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public DL_Writer(DL_Codes.dxfversion version)
 {
     _fileBuilder = new StringBuilder();
     _version = version;
     m_handle = 0x30;
     _modelSpaceHandle = 0;
     _paperSpaceHandle = 0;
     _paperSpace0Handle = 0;
 }
Beispiel #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 public DL_Writer(DL_Codes.dxfversion version)
 {
     _fileBuilder       = new StringBuilder();
     _version           = version;
     m_handle           = 0x30;
     _modelSpaceHandle  = 0;
     _paperSpaceHandle  = 0;
     _paperSpace0Handle = 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.AC1027;
            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(8);
             * 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("crease", 0));
             * dxf.WriteLineType(dw, new DL_LineTypeData("cut", 0));
             * dxf.WriteLineType(dw, new DL_LineTypeData("partial-cut", 0));
             * dxf.WriteLineType(dw, new DL_LineTypeData("1-2-x-1-2-cut", 0));
             * dxf.WriteLineType(dw, new DL_LineTypeData("1-4-x-1-4-cut", 0));
             * dxf.WriteLineType(dw, new DL_LineTypeData("1-8-x-1-8-cut", 0));
             * dxf.WriteLineType(dw, new DL_LineTypeData("3-8-x-3-8-cut", 0));
             * dw.TableEnd();
             * // writing the layers
             * int numberOfLayers = 1;
             * dw.tableLayers(numberOfLayers);
             * dxf.WriteLayer(dw, new DL_LayerData("Layer0", 0),
             *  new DL_Attributes("0",                       // leave empty
             *      (int)DL_Codes.dxfcolor.bylayer,         // default color
             *      100,                                    // default width
             *      "CONTINUOUS"));                         // default line style
             * dw.TableEnd();
             * dw.SectionEnd();
             */

            dxf.WritePredefinedHeader(dw);

            // write all entities
            dw.SectionEntities();
        }
Beispiel #4
0
 public DL_Dxf()
 {
     _version = DL_Codes.dxfversion.AC1009;
 }
Beispiel #5
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();
        }
Beispiel #6
0
 public DL_Dxf()
 {
     _version = DL_Codes.dxfversion.AC1009;
 }