乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 22|回复: 1

用VBA编程以后出现图形退化,程序代码如下,请教一下,是怎么回事?

[复制链接]

3

主题

9

帖子

3

银币

初来乍到

Rank: 1

铜币
21
发表于 2007-5-18 15:34:00 | 显示全部楼层 |阅读模式
问一下,图形退化是怎么回事?
程序如下:
Private Sub draw()
          '引用   Microsoft   Excel   11.0   Object   Library
          Dim xlsApp     As Excel.Application
          Dim eworkbook     As Workbook
          Dim eworksheet     As Worksheet
          Dim cir(0 To 1) As AcadEntity
          Dim b(0 To 2) As Double, g(0 To 2) As Double
          Dim c  As Double
          Dim x As Acad3DSolid
          Dim d As Double
          Dim e As Double
          Dim f As Double
          Dim re As Variant
          Dim height(0 To 1) As Double         
               
            e = 0
                        
          Set xlsApp = New Excel.Application
          Set eworkbook = xlsApp.Workbooks.Open("F:\国道112\坐标.xls")
          Set eworksheet = eworkbook.Sheets("8标的桥位坐标表")
          For j = 4 To 20
      
            For i = 4 To 118
            
             With eworksheet
            
                 b(0) = .Cells(i, j)
                 b(1) = .Cells(i, j + 1)
                 b(2) = .Cells(i, j + 2)
                    c = .Cells(i, j + 3)
                    height(0) = .Cells(i, j + 4)
                 g(0) = .Cells(i + 1, j)
                 g(1) = .Cells(i + 1, j + 1)
                 g(2) = .Cells(i + 1, j + 2)
                    f = .Cells(i + 1, j + 3)
                    height(1) = .Cells(i + 1, j + 4)
         
             End With
            
             Set cir(0) = ThisDrawing.ModelSpace.addcircle(b, c)
             Set cir(1) = ThisDrawing.ModelSpace.addcircle(g, f)
            
             re = ThisDrawing.ModelSpace.AddRegion(cir)
            
         
                                             
          Set x = ThisDrawing.ModelSpace.AddExtrudedSolid(re(0), -height(0), e) '此中的re(0),即acadregion必须为一个域,而不是一个数组。
          Set x = ThisDrawing.ModelSpace.AddExtrudedSolid(re(1), -height(1), e)
         
              i = i + 2
            
              Next i
              j = j + 16
              Next j
            
             ZoomAll
             eworkbook.Close
             xlsApp.Quit
            
          'eworkbook.Save
          Set xlsApp = Nothing
          Set eworkbook = Nothing
          Set eworksheet = Nothing
                                   
         End Sub
哪位高手给看一下是哪出问题了?
回复

使用道具 举报

55

主题

282

帖子

5

银币

中流砥柱

Rank: 25

铜币
502
发表于 2007-5-19 11:36:00 | 显示全部楼层
图形退化?不懂!
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-7 20:53 , Processed in 0.483871 second(s), 56 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表