I am building a Macro that will put holes in a part.
My Module has two subroutines, the first one calls the User Form Up, and then once I fill out the user form with all the hole specifications (Diameter, Depth, and Bottom of Hole Angle) and Click the OK button, it calls to the second subroutine in the Module to then go through the process of asking for Vectors and Loft Surface to put the holes in.
I can't figure out how to use the data from Combo Boxes and Textboxes in my User Form in my Module that gets called from the User Form.
Can anyone give me some help?
Module Sub Routines:
Userform OK Button Routine:
My Module has two subroutines, the first one calls the User Form Up, and then once I fill out the user form with all the hole specifications (Diameter, Depth, and Bottom of Hole Angle) and Click the OK button, it calls to the second subroutine in the Module to then go through the process of asking for Vectors and Loft Surface to put the holes in.
I can't figure out how to use the data from Combo Boxes and Textboxes in my User Form in my Module that gets called from the User Form.
Can anyone give me some help?
Module Sub Routines:
Code:
Sub CatMAIN()
Call frmHoleMenu.Show(Modeless)
End Sub
Code:
Public Sub BuildHolesx()
Dim oPartDoc As PartDocument
...lots of code...
Dim hole1 As Hole
Set hole1 = SF1.AddNewHoleFromPoint(coord(0), coord(1), coord(2), reference4, 10#)
hole1.Type = catSimpleHole
hole1.AnchorMode = catExtremPointHoleAnchor
hole1.BottomType = catVHoleBottom
Dim limit1 As Limit
Set limit1 = hole1.BottomLimit
limit1.LimitMode = catOffsetLimit
Dim length1 As Length
Set length1 = hole1.Diameter
'length1.Value = 10
length1.Value = hDiameter
Dim angle1 As Angle
Set angle1 = hole1.BottomAngle
'angle1.Value = 120
angle1.Value = hAngle
hole1.SetDirection reference1
hole1.ThreadingMode = catSmoothHoleThreading
hole1.ThreadSide = catRightThreadSide
part1.UpdateObject hole1
End Sub
Userform OK Button Routine:
Code:
Private Sub btnOK_Click()
Dim hDiameter As Length
Dim hDepth As Length
Dim hAngle As Angle
Set hDiameter = frmHoleMenu.txtbxDiameter.Value
Set hDepth = frmHoleMenu.txtbxDepth.Value
Set hAngle = frmHoleMenu.txtbxAngle.Value
Me.Hide
Call BuildHoles
frmHoleMenu.Hide
End Sub