Option Explicit Private Sub Application_SimulationGougeDetected( doc As FeatureCAM.MFGDocument, _ ByVal operation_name As String, ByVal StartedFromAPI As Boolean, _ ByVal SimID As Variant, Action As FeatureCAM.tagFMSimGougeType) Dim sim As FMSimOptions Set sim = Application.SimOptions If sim.Shaded3DPauseOnGouge Then PlaySound doc,"bomb.wav", "PlaySoundOnGouge" If sim.Shaded3DPauseOnGouge And Not sim.Shaded3DPauseOnGougeDlg Then Action = eSGT_PauseSim ElseIf sim.Shaded3DPauseOnGouge And sim.Shaded3DPauseOnGougeDlg Then Action = eSGT_ShowDialog End If End If End Sub Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _ (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Private Sub PlaySound(doc As FeatureCAM.MFGDocument, snd As String, macroname As String) Dim sndpath As String sndpath = MacroDir & "\" & snd On Error GoTo tilt FileLen(sndpath) sndPlaySound sndpath, 1 Exit Sub tilt: MsgBox macroname & " macro expected a sound file in the following path" + vbCrLf + _ sndpath + vbCrLf + _ "Please copy " & snd & " to this folder and re-try" End Sub