'This property is in the Expose DrawGear. Can be found in the Windows references and pointed to from VBA, Excel or ? Public Property Get LoadLocals(ByVal GearElement As Long, _ ByVal NumberOfTeeth As Long, _ ByVal PressureAngleDegrees As Double, _ ByVal CenterDistance As Double, _ ByVal Addendum As Double, _ ByVal WholeDepthFactor As Double, _ ByVal EdgeBreak As Double, _ ByVal ToothThickness As Double, _ ByVal InternalExternal As Integer, _ ByVal FullRootRadius As Boolean, _ Optional ByVal BackaLasha As Double, _ Optional ByVal Protuberance As Double, _ Optional ByVal OperatingTransDP As Double = 1, _ Optional ByVal DP0Module1 As Long = 0, _ Optional ByVal FileName As String) As Long 'optionals for a bit of a buffer. If GearElement < 1 Or GearElement > 4 Then Exit Property ' GetInputs = 0 On Error Resume Next N(GearElement) = NumberOfTeeth Phi = PressureAngleDegrees ADD(GearElement) = Addendum DED(GearElement) = WholeDepthFactor EGB(GearElement) = EdgeBreak TTK(GearElement) = ToothThickness Protube(GearElement) = Protuberance BKL = BackaLasha PG_FileName = FileName If GearElement = 2 Or GearElement = 3 Then FRR(GearElement) = FullRootRadius DCO(1) = CenterDistance If GearElement = 3 Then IntExt = InternalExternal If GearElement = 2 Then frmGears.mnuMesh(0).Visible = Not FullRootRadius If GearElement = 3 Then frmGears.mnuMesh(2).Visible = Not FullRootRadius Else If GearElement = 1 Then DCO(0) = CenterDistance ElseIf GearElement = 4 Then DCO(2) = CenterDistance End If End If Settings.GearSizer = 1 / OperatingTransDP 'Settings.GearSizerOPT = 0 'always passed as Diametral Pitch Settings.GearSizerOPT = DP0Module1 'Edit2002 If Err.Number <> 0 Then Exit Property ' GetInputs = 0 LoadLocals = 1 End Property 'This is where the DrawGear Exposure is called, note its called 4 times, once for each gear, tool-pinion-gear-tool. Public Function LaunchDrawing() As Long Dim Norm As Double Dim PDN As Double Dim PDT As Double Dim ModDP As Double Dim Dp0Mod1 As Long PDT = pd PDN = Pd_n Norm = PDN / PDT ' Norm > 1 if Psi > 0 Dim FName As String FName = Data1.ActiveFileName(False, True) deBugger "Sending " & FName & " data to DrawGear" If Metric = True Then ModDP = PDT / 25.4 Dp0Mod1 = 1 Else ModDP = PDT Dp0Mod1 = 0 End If Dim retval As Long 'close the current instance If Not mobjDraw Is Nothing Then On Error Resume Next 'mobjDraw.ExternalEndProgram True Set mobjDraw = Nothing End If Dim HobAdd As Double Dim HobTTk As Double 'On Error GoTo 0 On Error GoTo ErrHandler Set mobjDraw = New ExposeDrawGear 'Public Property Get LoadLocals(ByVal GearElement As Long, _ ByVal NumberOfTeeth As Long, _ ByVal PressureAngleDegrees As Double, _ ByVal CenterDistance As Double, _ ByVal Addendum As Double, _ ByVal WholeDepthFactor As Double, _ ByVal EdgeBreak As Double, _ ByVal ToothThickness As Double, _ ByVal InternalExternal As Integer, _ ByVal FullRootRadius As Boolean, _ Optional ByVal BackaLasha As Double, _ Optional ByVal Protuberance As Double, _ Optional ByVal OperatingTransDP As Double = 1, _ Optional ByVal DP0Module1 As Long = 0), _ Optional ByVal FileName as String) as long 'optionals for a bit of a buffer. With oPinion.oHob HobAdd = .Addendum * PDT: If HobAdd = 0 Then HobAdd = 1.25 ' HobTTk = .HobTTk * PDN / PI: If HobTTk = 0 Then HobTTk = 0.5 retval = mobjDraw.LoadLocals(1, 10000, R2D(Phi), _ .RackShift * PDT, _ HobAdd, _ 3, _ .TipRadius * PDN, _ HobTTk, _ 1, _ True, 0, _ .Protuberance * Norm, 0, 0, FName) End With With oPinion Dim Temp As Double Temp = .TTk_o(grActualTTK) / PC_o retval = mobjDraw.LoadLocals(2, .N, R2D(Phi), _ (DC_O - DC_s) * PDT, _ .AddF / Norm, _ .WDF / Norm, _ .EGB * PDN, _ .TTk_o(grActualTTK) / PC_o, _ 1, _ Not CBool(.FilletRadius), 0, 0, 0, 0, FName) End With With Ogear retval = mobjDraw.LoadLocals(3, .N, R2D(Phi), _ (DC_O - DC_s) * PDT, _ .AddF / Norm, _ .WDF / Norm, _ .EGB * PDN, _ .TTk_o(grActualTTK) / PC_o, _ .IntExt, _ Not CBool(.FilletRadius), 0, 0, 0, 0, FName) End With With Ogear.oHob HobAdd = .Addendum * PDT If HobAdd = 0 Then HobAdd = 1.25 ' HobTTk = .HobTTk * PDN / PI: If HobTTk = 0 Then HobTTk = 0.5 retval = mobjDraw.LoadLocals(4, 10000, R2D(Phi), _ .RackShift * PDT, _ HobAdd, _ 3, _ .TipRadius * PDN, _ HobTTk, _ 1, _ True, , .Protuberance * Norm, ModDP, Dp0Mod1, FName) End With mobjDraw.LaunchDrawings LaunchDrawing = 1 'query this for success deBugger "Sent drawing data okay." Exit Function ErrHandler: MsgBox Err.Description & vbCrLf & "error #" & Err.Number End Function