📄 form024.frm
字号:
Height = 180
Left = 600
TabIndex = 40
Top = 1995
Width = 1170
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "齿轮 齿数 = "
Height = 180
Left = 600
TabIndex = 39
Top = 1485
Width = 1170
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "1.请输入设计参数:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 600
TabIndex = 38
Top = 480
Width = 2040
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "2.确定图纸大小:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 600
TabIndex = 37
Top = 3600
Width = 1815
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "3.标题栏"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 600
TabIndex = 36
Top = 6120
Width = 915
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "制 图:"
Height = 180
Left = 600
TabIndex = 35
Top = 6600
Width = 900
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "绘 图:"
Height = 180
Left = 600
TabIndex = 34
Top = 7020
Width = 900
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "审 核:"
Height = 180
Left = 600
TabIndex = 33
Top = 7440
Width = 900
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "材 料:"
Height = 180
Left = 600
TabIndex = 32
Top = 7860
Width = 900
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "日 期:"
Height = 180
Left = 600
TabIndex = 31
Top = 8280
Width = 900
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "4.确定零件图比例:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 3600
TabIndex = 30
Top = 480
Width = 2040
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "5.填写技术条件:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 3600
TabIndex = 29
Top = 3600
Width = 1815
End
Begin VB.Label Label15
AutoSize = -1 'True
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "o"
Height = 180
Index = 1
Left = 3120
TabIndex = 28
Top = 2400
Width = 90
End
End
Attribute VB_Name = "Form024"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command3_Click()
'小齿轮绘图
acadapp.Documents.Add
Dim cz As Double
Dim cm As Double
Dim ca As Double
Dim cr As Double
'Dim crb As Double
Dim cra As Double
Dim crf As Double '齿数,模数,压力角,分度圆r,基圆r,齿顶圆r,齿底圆r
cz = Text2.Text '小齿轮齿数
cm = Text3.Text '模数
ca = Text4.Text * 3.1415926 / 180 '压力角
czd = Text11.Text '大齿轮齿数
'设置画图比例。
Dim u As Double
If Option6.Value = True Then
u = 1
End If
If Option7.Value = True Then
u = 1 / 2
End If
If Option8.Value = True Then
u = 1 / 5
End If
If Option9.Value = True Then
u = 1 / 10
End If
If Option10.Value = True Then
u = 5
End If
If Option11.Value = True Then
u = 2
End If
'计算出最原始的数据。…………………………………
cr = u * (cm * cz / 2) '分度圆半径
crf = u * (cm * cz - 2.4 * cm * Cos(a)) / 2 '齿根圆半径
'crb = u * cr * Cos(ca) '基圆半径
cra = u * (cm * cz + 2 * cm * Cos(a)) / 2 '齿顶圆半径
'画图纸。
Dim tzc As Double '图纸长
Dim tzk As Double '图纸宽
Dim e As Double
'确定图纸的长与宽。
If Option1.Value = True Then
tzc = 1189
tzg = 841
e = 20
End If
If Option2.Value = True Then
tzc = 841
tzg = 594
e = 20
End If
If Option3.Value = True Then
tzc = 594
tzg = 420
e = 10
End If
If Option4.Value = True Then
tzc = 420
tzg = 297
e = 10
End If
If Option5.Value = True Then
tzc = 297
tzg = 210
e = 10
End If
Dim tzdx1 As Double
Dim tzdx2 As Double
Dim tzdy1 As Double
Dim tzdy2 As Double
tzdx1 = -e
tzdx2 = tzc - e
tzdy1 = -e
tzdy2 = tzg - e
Dim tz As AcadLWPolyline
Dim points90(0 To 9) As Double '(-10,-10),(277,-10),(277,200),(-10,200),(-10,-10)
points90(0) = tzdx1: points90(1) = tzdy1
points90(2) = tzdx2: points90(3) = tzdy1
points90(4) = tzdx2: points90(5) = tzdy2
points90(6) = tzdx1: points90(7) = tzdy2
points90(8) = tzdx1: points90(9) = tzdy1
Set tz = acadapp.ActiveDocument.ModelSpace.AddLightWeightPolyline(points90)
'画图框(粗实线)。
Dim tkc As Double '图框长
Dim tkg As Double '图框高
tkc = tzc - 2 * e '选A4图纸
tkg = tzg - 2 * e
Dim tk As AcadLWPolyline
Dim points0(0 To 9) As Double '(0,0),(287,0),(287,200),(0,200),(0,0)
points0(0) = 0: points0(1) = 0
points0(2) = tkc: points0(3) = 0
points0(4) = tkc: points0(5) = tkg
points0(6) = 0: points0(7) = tkg
points0(8) = 0: points0(9) = 0
Set tk = acadapp.ActiveDocument.ModelSpace.AddLightWeightPolyline(points0)
tk.Lineweight = acLnWt030
'画齿轮剖视图 ''''''''''''''''''''''''''''''''''''''锥齿轮腹板式 da < 500mm
Dim zbjl As Double '左,右 边距离
Dim ybjl As Double
Dim zxxsp As Double '中心线左-水平线
Dim zxxy As Double '中心线右-竖线
Dim ndj As Double '内倒角
Dim bb As Double 'B
Dim cc As Double 'c
Dim j As Double 'J
Dim r As Double 'R
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -