Hallo ich habe es endlich hingekommen polylinien von excel nach autocad zu bekommen damit mein objekt dargestellt wird... alles funzt prima mit dem code... nur eines funktioniert nicht... die z koordinate funktioniert nicht.. er fügt alles bei null ein obwohl die z koordinate nicht null ist. die x y koordinaten funktionieren problemlos. kann mir einer sagen was ich falsch gemacht habe?..
Sub transfer()
Dim ac As AcadApplication
Dim acP(0 To 38) As Double
Dim acPa(0 To 38) As Double
Dim acPline As AcadPolyline
Dim acPaline As AcadPolyline
Set ac = New AcadApplication
ac.Visible = 1
acP(0) = Sheets("results").Cells(8, 9): acP(1) = Sheets("results").Cells(8, 10): acP(2) = Sheets("results").Cells(8, 11)
acP(3) = Sheets("results").Cells(9, 9): acP(4) = Sheets("results").Cells(9, 10): acP(5) = Sheets("results").Cells(9, 11)
acP(6) = Sheets("results").Cells(10, 9): acP(7) = Sheets("results").Cells(10, 10): acP(8) = Sheets("results").Cells(10, 11)
acP(9) = Sheets("results").Cells(11, 9): acP(10) = Sheets("results").Cells(11, 10): acP(11) = Sheets("results").Cells(11, 11)
acP(12) = Sheets("results").Cells(12, 9): acP(13) = Sheets("results").Cells(12, 10): acP(14) = Sheets("results").Cells(12, 11)
acP(15) = Sheets("results").Cells(13, 9): acP(16) = Sheets("results").Cells(13, 10): acP(17) = Sheets("results").Cells(13, 11)
acP(18) = Sheets("results").Cells(14, 9): acP(19) = Sheets("results").Cells(14, 10): acP(20) = Sheets("results").Cells(14, 11)
acP(21) = Sheets("results").Cells(15, 9): acP(22) = Sheets("results").Cells(15, 10): acP(23) = Sheets("results").Cells(15, 11)
acP(24) = Sheets("results").Cells(16, 9): acP(25) = Sheets("results").Cells(16, 10): acP(26) = Sheets("results").Cells(16, 11)
acP(27) = Sheets("results").Cells(17, 9): acP(28) = Sheets("results").Cells(17, 10): acP(29) = Sheets("results").Cells(17, 11)
acP(30) = Sheets("results").Cells(18, 9): acP(31) = Sheets("results").Cells(18, 10): acP(32) = Sheets("results").Cells(18, 11)
acP(33) = Sheets("results").Cells(19, 9): acP(34) = Sheets("results").Cells(19, 10): acP(35) = Sheets("results").Cells(19, 11)
acP(36) = Sheets("results").Cells(8, 9): acP(37) = Sheets("results").Cells(8, 10): acP(38) = Sheets("results").Cells(8, 11)
Set acPline = ac.ActiveDocument.ModelSpace.AddPolyline(acP)
acPa(0) = Sheets("results").Cells(8, 14): acPa(1) = Sheets("results").Cells(8, 15): acPa(2) = Sheets("results").Cells(8, 16)
acPa(3) = Sheets("results").Cells(9, 14): acPa(4) = Sheets("results").Cells(9, 15): acPa(5) = Sheets("results").Cells(9, 16)
acPa(6) = Sheets("results").Cells(10, 14): acPa(7) = Sheets("results").Cells(10, 15): acPa(8) = Sheets("results").Cells(10, 16)
acPa(9) = Sheets("results").Cells(11, 14): acPa(10) = Sheets("results").Cells(11, 15): acPa(11) = Sheets("results").Cells(11, 16)
acPa(12) = Sheets("results").Cells(12, 14): acPa(13) = Sheets("results").Cells(12, 15): acPa(14) = Sheets("results").Cells(12, 16)
acPa(15) = Sheets("results").Cells(13, 14): acPa(16) = Sheets("results").Cells(13, 15): acPa(17) = Sheets("results").Cells(13, 16)
acPa(18) = Sheets("results").Cells(14, 14): acPa(19) = Sheets("results").Cells(14, 15): acPa(20) = Sheets("results").Cells(14, 16)
acPa(21) = Sheets("results").Cells(15, 14): acPa(22) = Sheets("results").Cells(15, 15): acPa(23) = Sheets("results").Cells(15, 16)
acPa(24) = Sheets("results").Cells(16, 14): acPa(25) = Sheets("results").Cells(16, 15): acPa(26) = Sheets("results").Cells(16, 16)
acPa(27) = Sheets("results").Cells(17, 14): acPa(28) = Sheets("results").Cells(17, 15): acPa(29) = Sheets("results").Cells(17, 16)
acPa(30) = Sheets("results").Cells(18, 14): acPa(31) = Sheets("results").Cells(18, 15): acPa(32) = Sheets("results").Cells(18, 16)
acPa(33) = Sheets("results").Cells(19, 14): acPa(34) = Sheets("results").Cells(19, 15): acPa(35) = Sheets("results").Cells(19, 16)
acPa(36) = Sheets("results").Cells(8, 14): acPa(37) = Sheets("results").Cells(8, 15): acPa(38) = Sheets("results").Cells(8, 16)
Set acPaline = ac.ActiveDocument.ModelSpace.AddPolyline(acPa)
ac.ZoomExtents
End Sub
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP