用VBA编程以后出现图形退化,程序代码如下,请教一下,是怎么回事?
<p>问一下,图形退化是怎么回事?</p><p>程序如下:</p><p>Private Sub draw()<br/> '引用 Microsoft Excel 11.0 Object Library<br/> Dim xlsApp As Excel.Application<br/> Dim eworkbook As Workbook<br/> Dim eworksheet As Worksheet<br/> Dim cir(0 To 1) As AcadEntity<br/> Dim b(0 To 2) As Double, g(0 To 2) As Double<br/> Dim c As Double<br/> Dim x As Acad3DSolid<br/> Dim d As Double<br/> Dim e As Double<br/> Dim f As Double<br/> Dim re As Variant<br/> Dim height(0 To 1) As Double <br/> <br/> e = 0<br/> <br/> Set xlsApp = New Excel.Application<br/> Set eworkbook = xlsApp.Workbooks.Open("F:\国道112\坐标.xls")<br/> Set eworksheet = eworkbook.Sheets("8标的桥位坐标表")<br/> For j = 4 To 20<br/> <br/> For i = 4 To 118<br/> <br/> With eworksheet<br/> <br/> b(0) = .Cells(i, j)<br/> b(1) = .Cells(i, j + 1)<br/> b(2) = .Cells(i, j + 2)<br/> c = .Cells(i, j + 3)<br/> height(0) = .Cells(i, j + 4)<br/> g(0) = .Cells(i + 1, j)<br/> g(1) = .Cells(i + 1, j + 1)<br/> g(2) = .Cells(i + 1, j + 2)<br/> f = .Cells(i + 1, j + 3)<br/> height(1) = .Cells(i + 1, j + 4)<br/> <br/> End With<br/> <br/> Set cir(0) = ThisDrawing.ModelSpace.addcircle(b, c)<br/> Set cir(1) = ThisDrawing.ModelSpace.addcircle(g, f)<br/> <br/> re = ThisDrawing.ModelSpace.AddRegion(cir)<br/> <br/> <br/> <br/> Set x = ThisDrawing.ModelSpace.AddExtrudedSolid(re(0), -height(0), e) '此中的re(0),即acadregion必须为一个域,而不是一个数组。<br/> Set x = ThisDrawing.ModelSpace.AddExtrudedSolid(re(1), -height(1), e)<br/> <br/> i = i + 2<br/> <br/> Next i<br/> j = j + 16<br/> Next j<br/> <br/> ZoomAll<br/> eworkbook.Close<br/> xlsApp.Quit<br/> <br/> 'eworkbook.Save<br/> Set xlsApp = Nothing<br/> Set eworkbook = Nothing<br/> Set eworksheet = Nothing<br/> <br/> End Sub</p><p>哪位高手给看一下是哪出问题了?</p> 图形退化?不懂!
页:
[1]