Example #1
0
        public void writeLineType(DL_Writer dw, DL_LineTypeData data)
        {
            if (data.name.Length == 0)
                throw new DL_Exception("Line type name must not be empty");

	        // ignore BYLAYER, BYBLOCK for R12
            string sNameUpper = data.name.ToUpper(); 
	        if (_version<DL_Codes.VER_2000)
            {
                if ((sNameUpper.CompareTo("BYBLOCK") == 0) || (sNameUpper.CompareTo("BYLAYER") == 0))
                    return;
            }

        	// write id (not for R12)
            if (sNameUpper.CompareTo("BYBLOCK") == 0) {
                dw.tableLineTypeEntry(0x14);
            } else if (sNameUpper.CompareTo("BYLAYER") == 0) {
                dw.tableLineTypeEntry(0x15);
            } else if (sNameUpper.CompareTo("CONTINUOUS") == 0) {
                dw.tableLineTypeEntry(0x16);
            } else {
                dw.tableLineTypeEntry();
            }

            dw.dxfString(2, data.name);
    	    dw.dxfInt(70, data.flags);

            if (sNameUpper.CompareTo("BYBLOCK") == 0) {
                dw.dxfString(3, "");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 0);
                dw.dxfReal(40, 0.0);
            } else if (sNameUpper.CompareTo("BYLAYER") == 0 ) {
                dw.dxfString(3, "");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 0);
                dw.dxfReal(40, 0.0);
            } else if (sNameUpper.CompareTo("CONTINUOUS") == 0) {
                dw.dxfString(3, "Solid line");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 0);
                dw.dxfReal(40, 0.0);
            } else if (sNameUpper.CompareTo("ACAD_ISO02W100") == 0) {
                dw.dxfString(3, "ISO Dashed __ __ __ __ __ __ __ __ __ __ _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 15.0);
                dw.dxfReal(49, 12.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("ACAD_ISO03W100") == 0) {
                dw.dxfString(3, "ISO Dashed with Distance __    __    __    _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 30.0);
                dw.dxfReal(49, 12.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                    dw.dxfReal(49, -18.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("ACAD_ISO04W100") == 0) {
                dw.dxfString(3, "ISO Long Dashed Dotted ____ . ____ . __");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 30.0);
                dw.dxfReal(49, 24.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("ACAD_ISO05W100") == 0) {
                dw.dxfString(3, "ISO Long Dashed Double Dotted ____ .. __");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 33.0);
                dw.dxfReal(49, 24.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("BORDER") == 0) {
                dw.dxfString(3, "Border __ __ . __ __ . __ __ . __ __ . __ __ .");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 44.45);
                dw.dxfReal(49, 12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("BORDER2") == 0) {
                dw.dxfString(3, "Border (.5x) __.__.__.__.__.__.__.__.__.__.__.");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 22.225);
                dw.dxfReal(49, 6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("BORDERX2") == 0) {
                dw.dxfString(3, "Border (2x) ____  ____  .  ____  ____  .  ___");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 88.9);
                dw.dxfReal(49, 25.4);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 25.4);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("CENTER") == 0) {
                dw.dxfString(3, "Center ____ _ ____ _ ____ _ ____ _ ____ _ ____");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 50.8);
                dw.dxfReal(49, 31.75);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("CENTER2") == 0) {
                dw.dxfString(3, "Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 28.575);
                dw.dxfReal(49, 19.05);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("CENTERX2") == 0) {
                dw.dxfString(3, "Center (2x) ________  __  ________  __  _____");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 101.6);
                dw.dxfReal(49, 63.5);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DASHDOT") == 0) {
                dw.dxfString(3, "Dash dot __ . __ . __ . __ . __ . __ . __ . __");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 25.4);
                dw.dxfReal(49, 12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DASHDOT2") == 0) {
                dw.dxfString(3, "Dash dot (.5x) _._._._._._._._._._._._._._._.");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 12.7);
                dw.dxfReal(49, 6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DASHDOTX2") == 0) {
                dw.dxfString(3, "Dash dot (2x) ____  .  ____  .  ____  .  ___");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 50.8);
                dw.dxfReal(49, 25.4);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DASHED") == 0) {
                dw.dxfString(3, "Dashed __ __ __ __ __ __ __ __ __ __ __ __ __ _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 19.05);
                dw.dxfReal(49, 12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DASHED2") == 0) {
                dw.dxfString(3, "Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 9.525);
                dw.dxfReal(49, 6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DASHEDX2") == 0) {
                dw.dxfString(3, "Dashed (2x) ____  ____  ____  ____  ____  ___");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 38.1);
                dw.dxfReal(49, 25.4);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DIVIDE") == 0) {
                dw.dxfString(3, "Divide ____ . . ____ . . ____ . . ____ . . ____");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 31.75);
                dw.dxfReal(49, 12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DIVIDE2") == 0) {
                dw.dxfString(3, "Divide (.5x) __..__..__..__..__..__..__..__.._");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 15.875);
                dw.dxfReal(49, 6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DIVIDEX2") == 0) {
                dw.dxfString(3, "Divide (2x) ________  .  .  ________  .  .  _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 63.5);
                dw.dxfReal(49, 25.4);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DOT") == 0) {
                dw.dxfString(3, "Dot . . . . . . . . . . . . . . . . . . . . . .");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 6.35);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -6.35);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DOT2") == 0) {
                dw.dxfString(3, "Dot (.5x) .....................................");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 3.175);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -3.175);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else if (sNameUpper.CompareTo("DOTX2") == 0) {
                dw.dxfString(3, "Dot (2x) .  .  .  .  .  .  .  .  .  .  .  .  .");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 12.7);
                dw.dxfReal(49, 0.0);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
                dw.dxfReal(49, -12.7);
                if (_version>=DL_Codes.VER_R13)
                    dw.dxfInt(74, 0);
            } else {
                throw new DL_Exception("dxflib warning: DL_Dxf::writeLineType: Unknown Line Type");
            }
        }
Example #2
0
        public void writeLineType(DL_Writer dw, DL_LineTypeData data)
        {
            if (data.name.Length == 0)
            {
                throw new DL_Exception("Line type name must not be empty");
            }

            // ignore BYLAYER, BYBLOCK for R12
            string sNameUpper = data.name.ToUpper();

            if (_version < DL_Codes.VER_2000)
            {
                if ((sNameUpper.CompareTo("BYBLOCK") == 0) || (sNameUpper.CompareTo("BYLAYER") == 0))
                {
                    return;
                }
            }

            // write id (not for R12)
            if (sNameUpper.CompareTo("BYBLOCK") == 0)
            {
                dw.tableLineTypeEntry(0x14);
            }
            else if (sNameUpper.CompareTo("BYLAYER") == 0)
            {
                dw.tableLineTypeEntry(0x15);
            }
            else if (sNameUpper.CompareTo("CONTINUOUS") == 0)
            {
                dw.tableLineTypeEntry(0x16);
            }
            else
            {
                dw.tableLineTypeEntry();
            }

            dw.dxfString(2, data.name);
            dw.dxfInt(70, data.flags);

            if (sNameUpper.CompareTo("BYBLOCK") == 0)
            {
                dw.dxfString(3, "");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 0);
                dw.dxfReal(40, 0.0);
            }
            else if (sNameUpper.CompareTo("BYLAYER") == 0)
            {
                dw.dxfString(3, "");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 0);
                dw.dxfReal(40, 0.0);
            }
            else if (sNameUpper.CompareTo("CONTINUOUS") == 0)
            {
                dw.dxfString(3, "Solid line");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 0);
                dw.dxfReal(40, 0.0);
            }
            else if (sNameUpper.CompareTo("ACAD_ISO02W100") == 0)
            {
                dw.dxfString(3, "ISO Dashed __ __ __ __ __ __ __ __ __ __ _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 15.0);
                dw.dxfReal(49, 12.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("ACAD_ISO03W100") == 0)
            {
                dw.dxfString(3, "ISO Dashed with Distance __    __    __    _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 30.0);
                dw.dxfReal(49, 12.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -18.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("ACAD_ISO04W100") == 0)
            {
                dw.dxfString(3, "ISO Long Dashed Dotted ____ . ____ . __");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 30.0);
                dw.dxfReal(49, 24.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("ACAD_ISO05W100") == 0)
            {
                dw.dxfString(3, "ISO Long Dashed Double Dotted ____ .. __");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 33.0);
                dw.dxfReal(49, 24.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("BORDER") == 0)
            {
                dw.dxfString(3, "Border __ __ . __ __ . __ __ . __ __ . __ __ .");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 44.45);
                dw.dxfReal(49, 12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("BORDER2") == 0)
            {
                dw.dxfString(3, "Border (.5x) __.__.__.__.__.__.__.__.__.__.__.");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 22.225);
                dw.dxfReal(49, 6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("BORDERX2") == 0)
            {
                dw.dxfString(3, "Border (2x) ____  ____  .  ____  ____  .  ___");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 88.9);
                dw.dxfReal(49, 25.4);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 25.4);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("CENTER") == 0)
            {
                dw.dxfString(3, "Center ____ _ ____ _ ____ _ ____ _ ____ _ ____");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 50.8);
                dw.dxfReal(49, 31.75);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("CENTER2") == 0)
            {
                dw.dxfString(3, "Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 28.575);
                dw.dxfReal(49, 19.05);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("CENTERX2") == 0)
            {
                dw.dxfString(3, "Center (2x) ________  __  ________  __  _____");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 101.6);
                dw.dxfReal(49, 63.5);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DASHDOT") == 0)
            {
                dw.dxfString(3, "Dash dot __ . __ . __ . __ . __ . __ . __ . __");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 25.4);
                dw.dxfReal(49, 12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DASHDOT2") == 0)
            {
                dw.dxfString(3, "Dash dot (.5x) _._._._._._._._._._._._._._._.");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 12.7);
                dw.dxfReal(49, 6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DASHDOTX2") == 0)
            {
                dw.dxfString(3, "Dash dot (2x) ____  .  ____  .  ____  .  ___");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 4);
                dw.dxfReal(40, 50.8);
                dw.dxfReal(49, 25.4);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DASHED") == 0)
            {
                dw.dxfString(3, "Dashed __ __ __ __ __ __ __ __ __ __ __ __ __ _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 19.05);
                dw.dxfReal(49, 12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DASHED2") == 0)
            {
                dw.dxfString(3, "Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 9.525);
                dw.dxfReal(49, 6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DASHEDX2") == 0)
            {
                dw.dxfString(3, "Dashed (2x) ____  ____  ____  ____  ____  ___");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 38.1);
                dw.dxfReal(49, 25.4);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DIVIDE") == 0)
            {
                dw.dxfString(3, "Divide ____ . . ____ . . ____ . . ____ . . ____");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 31.75);
                dw.dxfReal(49, 12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DIVIDE2") == 0)
            {
                dw.dxfString(3, "Divide (.5x) __..__..__..__..__..__..__..__.._");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 15.875);
                dw.dxfReal(49, 6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DIVIDEX2") == 0)
            {
                dw.dxfString(3, "Divide (2x) ________  .  .  ________  .  .  _");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 6);
                dw.dxfReal(40, 63.5);
                dw.dxfReal(49, 25.4);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DOT") == 0)
            {
                dw.dxfString(3, "Dot . . . . . . . . . . . . . . . . . . . . . .");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 6.35);
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -6.35);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DOT2") == 0)
            {
                dw.dxfString(3, "Dot (.5x) .....................................");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 3.175);
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -3.175);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else if (sNameUpper.CompareTo("DOTX2") == 0)
            {
                dw.dxfString(3, "Dot (2x) .  .  .  .  .  .  .  .  .  .  .  .  .");
                dw.dxfInt(72, 65);
                dw.dxfInt(73, 2);
                dw.dxfReal(40, 12.7);
                dw.dxfReal(49, 0.0);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
                dw.dxfReal(49, -12.7);
                if (_version >= DL_Codes.VER_R13)
                {
                    dw.dxfInt(74, 0);
                }
            }
            else
            {
                throw new DL_Exception("dxflib warning: DL_Dxf::writeLineType: Unknown Line Type");
            }
        }
Example #3
0
        public void WriteLineType(DL_Writer dw, DL_LineTypeData data)
        {
            if (data.Name.Length == 0)
            {
                throw new DL_Exception("Line type name must not be empty");
            }

            string sNameUpper = data.Name.ToUpper();

            // write id (not for R12)
            if (sNameUpper.CompareTo("BYBLOCK") == 0)
            {
                dw.TableLineTypeEntry(0x14);
            }
            else if (sNameUpper.CompareTo("BYLAYER") == 0)
            {
                dw.TableLineTypeEntry(0x15);
            }
            else if (sNameUpper.CompareTo("CONTINUOUS") == 0)
            {
                dw.TableLineTypeEntry(0x16);
            }
            else
            {
                dw.TableLineTypeEntry();
            }

            dw.DxfString(2, data.Name);
            dw.DxfInt(70, data.Flags);

            if (sNameUpper.CompareTo("BYBLOCK") == 0)
            {
                dw.DxfString(3, "");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 0);
                dw.DxfReal(40, 0.0);
            }
            else if (sNameUpper.CompareTo("BYLAYER") == 0)
            {
                dw.DxfString(3, "");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 0);
                dw.DxfReal(40, 0.0);
            }
            else if (sNameUpper.CompareTo("CONTINUOUS") == 0)
            {
                dw.DxfString(3, "Solid line");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 0);
                dw.DxfReal(40, 0.0);
            }
            else if (sNameUpper.CompareTo("CREASE") == 0)
            {
                dw.DxfString(3, "_______________");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 0);
                dw.DxfReal(40, 0.0);
            }
            else if (sNameUpper.CompareTo("CUT") == 0)
            {
                dw.DxfString(3, "_______________");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 0);
                dw.DxfReal(40, 0.0);
            }
            else if (sNameUpper.CompareTo("PARTIAL-CUT") == 0)
            {
                dw.DxfString(3, "___ _ ___ _ ___");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 4);
                dw.DxfReal(40, 2.0);
                dw.DxfReal(49, 0.75);
                dw.DxfInt(74, 0);
            }
            else if (sNameUpper.CompareTo("1-2-X-1-2-CUT") == 0)
            {
                dw.DxfString(3, "_ _ _ _ _ _ _ _");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 2);
                dw.DxfReal(40, 1.0);
                dw.DxfReal(49, 0.5);
                dw.DxfInt(74, 0);
            }
            else if (sNameUpper.CompareTo("1-4-X-1-4-CUT") == 0)
            {
                dw.DxfString(3, "_ _ _ _ _ _ _ _");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 2);
                dw.DxfReal(40, 0.5);
                dw.DxfReal(49, 0.25);
                dw.DxfInt(74, 0);
                dw.DxfReal(49, -0.25);
                dw.DxfInt(74, 0);
            }
            else if (sNameUpper.CompareTo("1-8-X-1-8-CUT") == 0)
            {
                dw.DxfString(3, "_ _ _ _ _ _ _ _");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 2);
                dw.DxfReal(40, 0.25);
                dw.DxfReal(49, 0.125);
                dw.DxfInt(74, 0);
                dw.DxfReal(49, -0.125);
                dw.DxfInt(74, 0);
            }
            else if (sNameUpper.CompareTo("3-8-X-3-8-CUT") == 0)
            {
                dw.DxfString(3, "_ _ _ _ _ _ _ _");
                dw.DxfInt(72, 65);
                dw.DxfInt(73, 2);
                dw.DxfReal(40, 0.75);
                dw.DxfReal(49, 0.375);
                dw.DxfInt(74, 0);
                dw.DxfReal(49, -0.375);
                dw.DxfInt(74, 0);
            }
            else
            {
                throw new DL_Exception("dxflib warning: DL_Dxf::writeLineType: Unknown Line Type");
            }
        }