文件名称:netDxf的扩展示例
文件大小:6KB
文件格式:CS
更新时间:2023-04-18 19:03:24
netdxf dxf autocad
原创代码:对netdxf类库扩展的示例,构建你自己的dxf文件处理类。 C# public void AddText(string text, Vector3 position, double height, TextStyle style) { String lines = text; lines = lines.Replace("\r\n", "\n"); lines = lines.Replace("\n\r", "\n"); lines = lines.Replace("\r", "\n"); String[] splitstr = lines.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries); //Console.WriteLine("Length=" + splitstr.Length); for (int i = 0; i < splitstr.Length; i++) { Vector3 pos = new Vector3(); //Console.WriteLine(splitstr[i]); pos.X = position.X; pos.Y = position.Y - (1.0 + 2.0 / 3.0) * height * i; this.AddEntity(new Text(splitstr[i], pos, height, style)); } }