- Sub drawline2()
- Dim acadApp As Object
- Dim acadDoc As Object
- On Error Resume Next
- Set acadApp = GetObject(, "AutoCAD.Application")
- If err Then
- err.Clear
- Set acadApp = CreateObject("AutoCAD.Application")
- If err Then End
- End If
- Set acadDoc = acadApp.ActiveDocument
- Dim Aline As Object
- Dim PointS(2) As Double
- Dim PointE(2) As Double
- PointS(0) = Cells(2, 2)
- PointS(1) = Cells(2, 3)
- PointS(2) = Cells(2, 4)
- PointE(0) = Cells(3, 2)
- PointE(1) = Cells(3, 3)
- PointE(2) = Cells(3, 4)
-
- acadApp.Visible = True
- Set Aline = acadDoc.ModelSpace.AddLine(PointS, PointE)
- Aline.Highlight = True
- 'acadDoc.Application.ZoomExtents
- End Sub
|