Вы находитесь на странице: 1из 1

Sub AutoCADLineToExcel()

'sending line data to Excel


Dim ExcelApplication As Excel.Application
Dim ExcelWorksheet As Worksheet
Dim Point3D As Variant 'last point input'
Set ExcelApplication = CreateObject("Excel.Application")
ExcelApplication.Visible = True
ExcelApplication.Workbooks.Add
Set ExcelWorksheet = ExcelApplication.ActiveWorkbook.Sheets("Sheet1")
ExcelWorksheet.Cells(1, 1).Value = "Line"
ExcelWorksheet.Cells(2, 1).Value = "Start"
ExcelWorksheet.Cells(3, 1).Value = "Finish"
ExcelWorksheet.Range("A1:A3").Font.Bold = True
ExcelWorksheet.Cells(1, 2).Value = "X"
ExcelWorksheet.Cells(1, 3).Value = "Y"
ExcelWorksheet.Cells(1, 4).Value = "Z"
ExcelWorksheet.Range("B1:D1").Font.Bold = True
Point3D = ThisDrawing.Utility.GetPoint(, "Click on start of line!")
ExcelWorksheet.Cells(2, 2).Value = Point3D(0)
ExcelWorksheet.Cells(2, 3).Value = Point3D(1)
ExcelWorksheet.Cells(2, 4).Value = Point3D(2)
Point3D = ThisDrawing.Utility.GetPoint(, "Click on end of line!")
ExcelWorksheet.Cells(3, 2).Value = Point3D(0)
ExcelWorksheet.Cells(3, 3).Value = Point3D(1)
ExcelWorksheet.Cells(3, 4).Value = Point3D(2)
End Sub

Вам также может понравиться