• 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. ifvar statement inside script - toggle visibility

Stats

  • State Verified Answer
  • Replies 2
  • Subscribers 18
  • Views 2524
  • Members are here 0
More Content

ifvar statement inside script - toggle visibility

camdal894
camdal894 over 3 years ago

Currently I'm trying to optimize my scripts for toggling layer views.

I can use the following script to turn on Top layer for example:

setwindow pcb
trapsize 13046
QtSignal CVPLayerGrid CVPBoxAllTop clicked true

Or I can use the following to turn off Top layer:

setwindow pcb
trapsize 13046
QtSignal CVPLayerGrid CVPBoxAllTop clicked false

What is the proper syntax to have this script either turn on or off the layer depending on the current view. So far I'm trying the following but it's not working:

ifvar <setwindow pcb> "QtSignal CVPLayerGrid CVPBoxAllTop clicked true" "QtSignal CVPLayerGrid CVPBoxAllTop clicked false"
trapsize 13046

I'm assuming my syntax is wrong but referencing just the Allegro/APD design guide this is the farthest I've been able to get. Any help is extremely appreciated.

Cameron

  • Cancel
  • Sign in to reply
Parents
  • DavidJHutchins
    +1 DavidJHutchins over 3 years ago

    I gave up on trying to do that with scripts & went with a set of aliases that call the skill functionality directly, below are a few examples:

    alias vn '((axlVisibleDesign nil)(axlVisibleUpdate t))'

    alias va '((axlVisibleDesign t)(axlVisibleUpdate t))'

    alias vte '((axlVisibleLayer "etch/top" t)(axlVisibleLayer "pin/top" t)(axlVisibleLayer "via class/top" t)(axlVisibleLayer "drc error class/top" t)(axlVisibleUpdate t))'
    alias vbe '((axlVisibleLayer "etch/bottom" t)(axlVisibleLayer "pin/bottom" t)(axlVisibleLayer "via class/bottom" t)(axlVisibleLayer "drc error class/bottom" t)(axlVisibleUpdate t))'

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • camdal894
    0 camdal894 over 3 years ago in reply to DavidJHutchins

    Thanks a lot David, this appears to work very well! For anyone else reading this hoping to toggle on/off with the same command, can put this into toggle using the following:

    alias qttopon '((axlVisibleLayer "etch/top" t)(axlVisibleLayer "pin/top" t)(axlVisibleLayer "via class/top" t)(axlVisibleLayer "drc error class/top" t)(axlVisibleUpdate t))'

    alias qttopof '((axlVisibleLayer "etch/top" nil)(axlVisibleLayer "pin/top" nil)(axlVisibleLayer "via class/top" nil)(axlVisibleLayer "drc error class/top" nil)(axlVisibleUpdate nil))'

    alias qttop 'settoggle CMD qttopon qttopof;$CMD'

    Using alias "qttop" which I have assigned to a key in my x-keys, I can toggle on and off the classes.

    Thanks again!

    Cameron


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • camdal894
    0 camdal894 over 3 years ago in reply to DavidJHutchins

    Thanks a lot David, this appears to work very well! For anyone else reading this hoping to toggle on/off with the same command, can put this into toggle using the following:

    alias qttopon '((axlVisibleLayer "etch/top" t)(axlVisibleLayer "pin/top" t)(axlVisibleLayer "via class/top" t)(axlVisibleLayer "drc error class/top" t)(axlVisibleUpdate t))'

    alias qttopof '((axlVisibleLayer "etch/top" nil)(axlVisibleLayer "pin/top" nil)(axlVisibleLayer "via class/top" nil)(axlVisibleLayer "drc error class/top" nil)(axlVisibleUpdate nil))'

    alias qttop 'settoggle CMD qttopon qttopof;$CMD'

    Using alias "qttop" which I have assigned to a key in my x-keys, I can toggle on and off the classes.

    Thanks again!

    Cameron


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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