AnsweredAssumed Answered

How to set an option on a second level form.

Question asked by equantie1 on Mar 26, 2012
Latest reply on Mar 26, 2012 by john_dube

Ok John I am trying to do something you said we couldn't do, but I don't understand why this doesn't work.  Is there a builtin restriction or am I doing it wrong?

The following locks after second form opened.

 

See following expedition code.

Option Explicit

'

' The example below opens the Gerber output dialog and generates

' gerber with the current settings

'

Sub Execute_Process  ()

    Dim resultMess

    Dim retBool,diaObj,dia2Obj

    Dim butObj

    Dim chkobj

 

    retBool = app.Gui.ProcessCommand("Setup->Project Integration",True)

    If (retBool = False) Then

        Call app.Gui.StatusBarText("Project Integration " + _

                                   Err.Description,epcbStatusFieldError)

        Exit Sub

    End If

    Set diaObj = app.Gui.FindDialog("Project Integration")

    If (Err Or (diaObj Is Nothing)) Then

        Call app.Gui.StatusBarText("Project Integration dialog not found " + _

                                   Err.Description,epcbStatusFieldError)

        Exit Sub

    End If

    'msgbox "hello1"

    ' Find the process button

    Set butObj = diaObj.FindButton("Additional Options...")

    'msgbox "hello2"

    If (butObj Is Nothing) Then

        Call app.Gui.StatusBarText("Additional Options Button not found " + Err.Description,epcbStatusFieldError)

        msgbox "hello3"

        Exit Sub

    End if

 

    ' Click the OK button . This will open the Additional Options Form

    Call butObj.Click

    msgbox "hello4"

    Set dia2Obj = app.Gui.FindDialog("Additional Options")

    msgbox "hello5"

    If (Err Or (dia2Obj Is Nothing)) Then

        Call app.Gui.StatusBarText("Additional Options dialog not found " + Err.Description,epcbStatusFieldError)

        msgbox "hello6"

        Exit Sub

    End If

 

 

    Set chkObj = dia2Obj.FindCheckBox("Back annotate cell names to schematic1")

    If (Err Or chkObj Is Nothing) Then

        Call app.Gui.DisplayMessage("Back annotate cell names to schematic check not found " + _

                                   Err.Description,epcbStatusFieldError)

        Exit Sub

    End if

         Call app.Gui.DisplayMessage("Here " + _

                                   Err.Description,epcbStatusFieldError)

 

 

    Call chkObj.Checked(True)

 

 

    'app.Gui.SuppressTrivialDialogs = True

End Sub

Outcomes