Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27417

VS 2005 How to draw LINE or Polyline in Autocad with VBA ?

$
0
0
Please,help !!
I want to draw LINE or Polyline in Autocad with Visual Basic 2005,but I don't know how ?
Does anyone know ?
What is problem on my code ?

Public Class Form1
Public acadApp As Autodesk.AutoCAD.Interop.AcadApplication
Public adoc As Autodesk.AutoCAD.Interop.AcadDocument
Public line As Autodesk.AutoCAD.Interop.Common.AcadLine
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
acadApp = GetObject(, "Autocad.Application")
adoc = acadApp.ActiveDocument
Dim a(0 To 2) As Double
Dim b(0 To 2) As Double
a(0) = 0 : a(1) = 0 : a(2) = 0
b(0) = 10000 : b(1) = 20000 : b(2) = 0
line = adoc.ModelSpace.AddLine(a, b)
End Sub
End Class

Viewing all articles
Browse latest Browse all 27417

Latest Images

Trending Articles



Latest Images