没有合适的资源?快使用搜索试试~ 我知道了~
C#读取DXF文件.doc
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 13 浏览量
2021-10-07
16:11:41
上传
评论
收藏 49KB DOC 举报
温馨提示
试读
17页
C#读取DXF文件.doc
资源推荐
资源详情
资源评论
- .
using System;
using System.Collections.Generic;
using System.ponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Collections;
namespace DXF
{
publicpartialclassForm1 : Form
{
privateFileStream fs;
privateStreamReader sr;
privateArrayList LayerList = newArrayList();
privateArrayList LineList = newArrayList();
privateArrayList ArcList=newArrayList();
privateArrayList EllipseList = newArrayList();
privateArrayList LwopolylineList = newArrayList();
privateArrayList SplineList=newArrayList();
privatestring[] str = newstring[2];
privateint count;
privatedouble leftx;
privatedouble lefty;
- -.可修编- .
- .
privatedouble rightx;
privatedouble righty;
public Form1()
{
Initializeponent();
}
privatestring[] ReadPair()
{
string code = sr.ReadLine().Trim();
string codedata = sr.ReadLine().Trim();
count += 2;
string[] result = newstring[2] { code, codedata };
return result;
}
privatevoid Read()
{
while (sr.Peek() != -1)
{
str = ReadPair();
if (str[1] == "SECTION")
{
str = ReadPair();
switch (str[1])
- -.可修编- .
- .
{
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;
}
privatevoid ReadTable()
{
while (str[1] != "ENDSEC")
{
while (str[0] != "2" || str[1] != "LAYER")
{
str = ReadPair();
}
- -.可修编- .
- .
while (str[0] != "0" || str[1] != "LAYER")
{
str = ReadPair();
}
while (str[0] == "0" && str[1] == "LAYER")
{
ReadLAYER();
}
while (str[1] != "ENDSEC")
{
str = ReadPair();
}
}
}
privatevoid ReadLAYER()
{
LAYER newlayer = newLAYER();
while (str[1] != "ENDTAB")
{
str = ReadPair();
switch (str[0])
{
case"2": newlayer.name = str[1];
break;
case"62": newlayer.colornum = str[1];
- -.可修编- .
剩余16页未读,继续阅读
资源评论
gjmm89
- 粉丝: 14
- 资源: 19万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功