明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2240|回复: 1

常用材料表格式。

[复制链接]
发表于 2009-8-20 21:52:00 | 显示全部楼层 |阅读模式
Sub MaterialTitle()
  Dim cadApp As AcadApplication
  Set cadApp = ConnectCad
  Dim xArr, textTitle, heightTitle, materialRow
  xArr = Array(0, 20, 50, 97, 107, 137, 148.5, 160, 171.5, 180)
  textitle = Array("件  号", "图号或标准号", "名           称", "数量", "材    料", "单", "总", "质 量(kg)", "备   注")
  Dim pp0(2) As Double, pp1(2) As Double
    materialRow = 13
    'heightTitle = 14 + 8 * materialRow
    pp1(0) = 180
  With cadApp.ActiveDocument.ModelSpace
    For ii = 0 To materialRow + 2
      If ii = 0 Then
        heightTitle = 0
      ElseIf ii = 1 Then
        heightTitle = 14
      Else
        heightTitle = heightTitle + 8
      End If
     
      pp0(1) = heightTitle:
      pp1(1) = pp0(1)
      Set objLine = .AddLine(pp0, pp1)
    Next ii
    ''
    Dim p0(2) As Double, p1(2) As Double
    p0(1) = 0: p1(1) = heightTitle
    For jj = 0 To UBound(xArr)
      p0(0) = xArr(jj): p1(0) = p0(0)
      Set objLine = .AddLine(p0, p1)
    Next jj
  End With
End Sub
发表于 2018-11-12 15:21:27 | 显示全部楼层
Set cadApp = Conne   错误要求对象怎么回事
   
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-25 06:31 , Processed in 0.160961 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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