以下程序只能读取dxf文件中多段线(二维)的一个点的坐标(左端点),但多段线有三个点,哪位大神能帮忙改改。
using System;using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string fn = @"1.dxf";
ReadDxf rd = new ReadDxf(fn);
ArrayList abc = new ArrayList();
abc=rd.ReadPolyline(@"0");
double[,] ps=new double[abc.Count,2];
for (int i = 0; i < abc.Count; i++)
{
double[] ds = new double[2];
ds = (double[])abc[i];
ps[i, 0] = ds[0]; ps[i, 1] = ds[1];
WriteToFile wtf = new WriteToFile(@"1.txt");
string[] str = new string[2];
str[0] = ps[0, 0].ToString("F3");
str[1] = ps[0, 1].ToString("F3");
wtf.WriteStringByLine(str);
wtf.Close();
}
}
}
}
(ReadDxf为引用的类)