Message 1 of 5
excel to autocad with vba
Not applicable
12-12-2019
01:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello,
i tried to write a little code that takes text from excel table's cell and write it in autocad but still can't execute it.
********************************************************
Sub DrawAutocadline()
Dim AutocadApplication As Autocad.Application
Dim startline(0 To 2) As Double
Dim endline(0 To 2) As Double
Set AutocadApplication = CreatObject("Autocad.Application")
startline(0) = Cells(2, 2).Value
startline(1) = Cells(3, 2).Value
endline(0) = Cells(2, 3).Value
endline(1) = Cells(3, 3).Value
AutocadApplication.ActiveDocument.ModelSpace.AddLine(startline, endline)
End Sub
****************************************************
if someone can correct my code or suggest me another one i will be grateful.
Thanks