Hello everybody. In a program that I am creating I have inserted a button that must create a .dxf file. With the code I wrote the .dxf file is created correctly but if I try to open it in AutoCAD, the file does not open. To try to understand why I tried to copy and paste the contents of the .dxf file into another empty .dxf file. If I do this the new .dxf file is opened correctly by AutoCAD.
Place the code I wrote.
Where do you think I'm wrong?
Bye, thank you very much.
Place the code I wrote.
Code:
Private Sub dxf_Click(sender As Object, e As EventArgs) Handles dxf.Click
SaveFileDialog1.Filter = "DXF Files (*.dxf)|*.dxf"
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim file As System.IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter(SaveFileDialog1.FileName, False)
file.WriteLine("0")
file.WriteLine("SECTION")
file.WriteLine("2")
file.WriteLine("ENTITIES")
file.WriteLine("0")
file.WriteLine("LINE")
file.WriteLine("8")
file.WriteLine("ASSE_X")
file.WriteLine("10")
file.WriteLine("100")
file.WriteLine("20")
file.WriteLine("0")
file.WriteLine("30")
file.WriteLine("0")
file.WriteLine("11")
file.WriteLine("200")
file.WriteLine("21")
file.WriteLine("0")
file.WriteLine("31")
file.WriteLine("0")
file.WriteLine("0")
file.WriteLine("ENDSEC")
file.WriteLine("0")
file.Write("EOF")
file.Close()
End If
End Sub
Bye, thank you very much.