明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 999|回复: 1

[原创]VB的function功能在标准零件绘图中的应用。

[复制链接]
发表于 2008-3-19 09:27:00 | 显示全部楼层 |阅读模式

以下数据是HG20592法兰的标准数据   

    HG20592_25_25 = Array(25, 0.25, 100, 75, 11, 4, 33.7, 32, 58, 2, "M10")
    HG20592_15_25 = Array(15, 0.25, 80, 55, 11, 4, 21.3, 18, 38, 2, "M10")
    HG20592_10_25 = Array(10, 0.25, 75, 50, 11, 4, 17.2, 14, 33, 2, "M10")
采用VBA/VB自定义数据类型工作效率比较高。

In module Model

Type HG20592_Table7_1AndTable8_0_1
    公称通径    As Double
    压力等级    As Double
    法兰外径D   As Double
    螺栓孔中心圆直径    As Double
    螺栓孔直径  As Double
    螺栓数量    As Double
    钢管外径A   As Double
    钢管外径B   As Double
    突台外径d   As Double
    突台高f1    As Double
    螺纹规格    As String
End Type

' //In Class Model

Private Function HG20592_Table7_1AndTable8_0_1Array() As HG20592_Table7_1AndTable8_0_1
    HG20592_25_25 = Array(25, 0.25, 100, 75, 11, 4, 33.7, 32, 58, 2, "M10")
    HG20592_15_25 = Array(15, 0.25, 80, 55, 11, 4, 21.3, 18, 38, 2, "M10")
    HG20592_10_25 = Array(10, 0.25, 75, 50, 11, 4, 17.2, 14, 33, 2, "M10")
    HG20592_20_25 = Array(20, 0.25, 90, 65, 11, 4, 26.9, 25, 48, 2, "M10")
    HG20592_20_60 = Array(20, 0.6, 90, 65, 11, 4, 26.9, 25, 48, 2, "M10")
    HG20592_10_60 = Array(10, 0.6, 75, 50, 11, 4, 17.2, 14, 33, 2, "M10")
    HG20592_25_60 = Array(25, 0.6, 100, 75, 11, 4, 33.7, 32, 58, 2, "M10")
  
    HG20592_Table7_1AndTable8_0_1Array.公称通径 = HG20592_2000_160(2)
 
End Function

Function ll()
  Dim gg As HG20592_Table7_1AndTable8_0_1
  gg.公称通径 = HG20592_Table7_1AndTable8_0_1Array.公称通径
  Debug.Print gg.公称通径
End Function

'end Class model

In form Model

Dim aa As New class1

Private Sub Form_Load()
  aa.ll
End Sub

发表于 2008-3-19 09:44:00 | 显示全部楼层

呵呵,思路很不错,顶

不过HG20592_Table7_1AndTable8_0_1Array好像写得不完整啊,没有实现预期目标,新手可能看不懂啊。建议补完全.

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

本版积分规则

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

GMT+8, 2024-11-26 11:57 , Processed in 0.145971 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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