明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4935|回复: 4

用excel中的数据绘图

[复制链接]
发表于 2007-5-11 15:26 | 显示全部楼层 |阅读模式

哪位高手帮忙看一下下面的程序有什么问题,总是运行不对,先谢谢了!

Private Sub draw()
        
          Dim xlsApp     As Excel.Application
          Dim eworkbook     As Workbook
          Dim eworksheet     As Worksheet
          Dim cir As AcadEntity
          Dim b(0 To 2) As Double
          Dim c  As Double
          Dim x As Acad3DSolid
          Dim d As Double
          Dim e As Double
          Dim re As Variant
          Dim height As Double
            hight = 500
            e = 0
          Set xlsApp = New Excel.Application
          Set eworkbook = xlsApp.Workbooks.Open("F:\国道112\坐标.xls")
          Set eworksheet = eworkbook.Sheets("8标的桥位坐标表")
      
            For i = 4 To 118
            
             With eworksheet
            
                 b(0) = .Cells(i, 4)
                 b(1) = .Cells(i, 5)
                 b(2) = .Cells(i, 6)
                    c = .Cells(i, 7)
         
             End With
             Set cir = ThisDrawing.ModelSpace.addcircle(b, c)
             re = ThisDrawing.ModelSpace.AddRegion(cir)
          Set x = ThisDrawing.ModelSpace.AddExtrudedSolid(re, height, e)
            
             Next i
             ZoomAll
              
          eworkbook.Close
          xlsApp.Quit
                        
         End Sub

发表于 2010-5-30 16:49 | 显示全部楼层
新手,路过,学习中.不能给你答案了.
发表于 2010-6-3 10:26 | 显示全部楼层

 Set x = ThisDrawing.ModelSpace.AddExtrudedSolid(re, height, e)改为

 Set x = ThisDrawing.ModelSpace.AddExtrudedSolid(re(0), height, e)?

发表于 2011-4-2 13:06 | 显示全部楼层
我正在初学中,无法解决这个问题。
发表于 2011-12-11 22:45 | 显示全部楼层
太过于深奥。请求高手。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-25 01:12 , Processed in 0.175141 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表