资源预览内容
第1页 / 共17页
第2页 / 共17页
第3页 / 共17页
第4页 / 共17页
第5页 / 共17页
第6页 / 共17页
第7页 / 共17页
第8页 / 共17页
第9页 / 共17页
第10页 / 共17页
亲,该文档总共17页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;using System.Collections;namespace DXF public partial class Form1 : Form private FileStream fs; private StreamReader sr; private ArrayList LayerList = new ArrayList(); private ArrayList LineList = new ArrayList(); private ArrayList ArcList=new ArrayList(); private ArrayList EllipseList = new ArrayList(); private ArrayList LwopolylineList = new ArrayList(); private ArrayList SplineList=new ArrayList(); private string str = new string2; private int count; private double leftx; private double lefty; private double rightx; private double righty; public Form1() InitializeComponent(); private string ReadPair() string code = sr.ReadLine().Trim(); string codedata = sr.ReadLine().Trim(); count += 2; string result = new string2 code, codedata ; return result; private void Read() while (sr.Peek() != -1) str = ReadPair(); if (str1 = SECTION) str = ReadPair(); switch (str1) case HEADER: ReadHeader(); break; case TABLES: ReadTable(); break; case ENTITIES: ReadEntities(); break; sr.Close(); fs.Close(); btDraw.Enabled = true; label1.Text = count.ToString(); count = 0; private void ReadTable() while (str1 != ENDSEC) while (str0 != 2 | str1 != LAYER) str = ReadPair(); while (str0 != 0 | str1 != LAYER) str = ReadPair(); while (str0 = 0 & str1 = LAYER) ReadLAYER(); while (str1 != ENDSEC) str = ReadPair(); private void ReadLAYER() LAYER newlayer = new LAYER(); while (str1 != ENDTAB) str = ReadPair(); switch (str0) case 2: newlayer.name = str1; break; case 62: newlayer.colornum = str1; break; case 6: newlayer.lbreak; case 370: newlayer.lwidth = str1; break; if (str0 = 0 & str1 = LAYER) LayerList.Add(newlayer); return; LayerList.Add(newlayer); private void ReadEntities() while (str1 != ENDSEC) switch (str1) case LINE: ReadLine(); break; case ARC: ReadArc(); break; case CIRCLE: ReadArc(); break; case ELLIPSE: ReadEllipse(); break; case LWPOLYLINE: ReadLwpolyline(); break; case SPLINE: ReadSpline(); break; default: str = ReadPair(); break; private void ReadArc() ARC newarc = new ARC(); while (str1 != ENDSEC) str = ReadPair(); switch (str0) case 8: newarc.LName = str1; break; case 10: newarc.CenterX = Double.Parse(str1); break; case 20: newarc.CenterY = Double.Parse(str1); break; case 40: newarc.Radiu = Double.Parse(str1); break; case 50: newarc.SAngle = Double.Parse
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号