1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
Option Explicit Type Point3D '3차원 점의 좌표를 위한 사용자정의자료형 X As Double Y As Double Z As Double End Type Public Sub WriteLineDXF(fileNo As Integer, StartPoint As Point3D, EndPoint As Point3D) Dim DXFCode As Integer 'DXF Group Code Dim DXFValue As Variant 'DXF value ' DXFCode = 0 Print #fileNo, Format(DXFCode, "@@@") DXFValue = "LINE" Print #fileNo, DXFValue ' DXFCode = 8 Print #fileNo, Format(DXFCode, "@@@") DXFValue = 0 Print #fileNo, DXFValue ' DXFCode = 62 Print #fileNo, Format(DXFCode, "@@@") DXFValue = 4 Print #fileNo, DXFValue ' DXFCode = 10 Print #fileNo, Format(DXFCode, "@@@") DXFValue = StartPoint.X Print #fileNo, DXFValue ' DXFCode = 20 Print #fileNo, Format(DXFCode, "@@@") DXFValue = StartPoint.Y Print #fileNo, DXFValue ' DXFCode = 30 Print #fileNo, Format(DXFCode, "@@@") DXFValue = StartPoint.Z Print #fileNo, DXFValue ' DXFCode = 11 Print #fileNo, Format(DXFCode, "@@@") DXFValue = EndPoint.X Print #fileNo, DXFValue ' DXFCode = 21 Print #fileNo, Format(DXFCode, "@@@") DXFValue = EndPoint.Y Print #fileNo, DXFValue ' DXFCode = 31 Print #fileNo, Format(DXFCode, "@@@") DXFValue = EndPoint.Z Print #fileNo, DXFValue End Sub |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
Sub TestFile() Dim fileName As String, textData As String, fileNo As Integer ' Dim DXFCode As Integer 'DXF Group Code Dim DXFValue As Variant 'DXF value ' fileName = "C:\MyChair.DXF" ' for Mac fileNo = FreeFile 'Get first free file number ' ' Open fileName For Output As #fileNo ' DXFCode = 999 Print #fileNo, Format(DXFCode, "@@@") DXFValue = "Created by SolarView" Print #fileNo, DXFValue ' DXFCode = 10 Print #fileNo, Format(DXFCode, "@@@") DXFValue = 12.5 Print #fileNo, DXFValue ' Close #fileNo End Sub |