AnsweredAssumed Answered

How to add wait program (Script) till user press any key on dialog box

Question asked by amol.rade@knorr-bremse.com on Jul 4, 2020
Latest reply on Jul 12, 2020 by amol.rade@knorr-bremse.com

Hello All,

 

i have written below script.

 

Sub NCDRILL()

Scripting.AddTypeLibrary("MGCPCB.ExpeditionPCBApplication")
'Dim oGerberEngine
' Set the design file name
'oGerberEngine.DesignFileName = jobName

' Get design Config directory
Dim pcbPath
pcbPath = Split(jobName, "PCB")
jobConfigPath = pcbPath(0) + "PCB/Config/"

Dim Drill

Drill = MsgBox ("Do you want to Generate NC DRILL", VBYesNo + VBQuestion, "NC DRILL Generator")

If Drill = VBYes Then
Drill = app.Gui.ProcessCommand("Output->NC Drill",True)

If (Drill = False) Then
Call app.Gui.StatusBarText("NC Drill Generator not found " + _
Err.Description,epcbStatusFieldError)
Exit Sub

End If

' Find the dialog
Dim diaObj
Set diaObj = app.Gui.FindDialog("NC Drill Generation")
If (Err Or (diaObj Is Nothing)) Then
Call app.Gui.StatusBarText("NC Drill Generator dialog not found " + _
                                                                               Err.Description,epcbStatusFieldError)
Exit Sub
End If

' Find the process button
Dim butObj
Set butObj = diaObj.FindButton("OK")
If (butObj Is Nothing) Then
Call app.Gui.StatusBarText("NC Drill Generator- OK button not found " + _
                                                                              Err.Description,epcbStatusFieldError)
Exit Sub
End if

' Click the OK button . This will generate the gerber
Call butObj.Click               'Here i want to addwait for user press OK key


Else
Exit Sub
End If

End Sub

 

 

This script is generating NC drill data with predefined setting, But i want to do changes like script has to wait till user press OK button on NC drill dialog.

 

Please let me know if any one know this.

 

Thanks in advance

Outcomes