• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X Scripting - Skill
  3. CHECKBOX in the FORM during the while loop

Stats

  • State Verified Answer
  • Replies 4
  • Answers 1
  • Subscribers 18
  • Views 2699
  • Members are here 0
More Content

CHECKBOX in the FORM during the while loop

JuriV
JuriV over 2 years ago

Hi everybody,
do you know how is possible to check CHECKBOX in the FORM during the while loop?
In my FORM I have two checkboxes. In the EVENT procedure (including a WHILE loop) I want implement in the PICK section:

     "Do something 1" if CHECKBOX1 in the FORM is checked
     "Do something 2" if CHECKBOX2 in the FORM is checked

In my code this not works, because the CHECKBOX in the FORM cannot not be CHECKED in the loop. The loop must be interrupted (e.g. with axlCancelOn())  to make check in the FORM.
Do you know if this works without interruption?

Hier is example:

test_form = axlFormCreate( (gensym) "test_form.form" nil 'test _action t)
(including CHECKBOX 1 and CHECKBOX 2)

procedure( test_form()
eventMask = '( PICK CANCEL DONE)
loop = t
while( loop   
   
     event = axlEnterEvent(eventMask, nil, t)
     case(event -> type
    
     ('PICK             
        if CHECKBOX 1 then do work 1…..
        if CHECKBOX 2 then do work 2…..    
     ); end PICK

 ('CANCEL
     printf("End of Loop")
     loop=nil        
 );end CANCEL
  );end while
  );end case      
);end procedure

Thanks
JuriV

  • Sign in to reply
  • Cancel
  • John T
    0 John T over 2 years ago

    Hi JuriV, in past forums there is a discussion regarding How to keep form window Active while running scripts:

    https://community.cadence.com/cadence_technology_forums/pcb-design/f/pcb-editor-skill/17997/how-to-keep-form-window-active-while-running-scripts

    In this there is information how to retain an active form by adding axlUIWPerm(lib_form, t) after the axlFormCreate command. Could this be of use to you in this scenario?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JuriV
    0 JuriV over 2 years ago in reply to John T

    Hi John T,
    thank you for the reply. Unfortunately it not works.
    The FORM is not activ in the loop. I need to interrupt the loop first.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mahimag
    0 mahimag over 2 years ago

    Hi @JuriV,  to set/unset the checkbox inside while loop is as an interupting event.  I tried something like

    while(axlFormGetField(fls "inc_summary") printf("hello"))

    axlFormSetField(fls "inc_summary" nil)

    It did not work because, while loop needs to be interupted (or you need to come out of the while Loop) in order to change the checkbox filed value.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • JuriV
    +1 JuriV over 2 years ago in reply to mahimag

    I have done it with axlFormSetEventAction( form 'form_callback). Its works even during the while loop.

    while( eventloop       
                event = axlEnterEvent(list('STARTDRAG 'PICK 'STOPDRAG) nil nil)

    ....

     ('STOPDRAG

    axlFormSetEventAction( form 'form_callback)
                                               when( form -> curField == "Checkbox1"   
                                                              do something 1 ()
                                               ); end when      

                                                                               
                                               when( form -> curField == "Checkbox2"   
                                                              do something 2 ()                                                
                                                 ); end when                                                   

                                            ); end while

    procedure( form_callback(form)

    printf("Checkbox is changed" )

    );end

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information