• 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. Custom IC Design
  3. How to Toggle Metal Layer Visibility Sequentially with Bindkeys...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 125
  • Views 2093
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to Toggle Metal Layer Visibility Sequentially with Bindkeys?

SS202502085313
SS202502085313 6 months ago

I require a script that allows toggling the visibility of multiple metal layers (from M1 to M10) without disabling the visibility of previously activated layers. For example, pressing the '1' bindkey should toggle the visibility of the M1 metal layer, while maintaining the visibility of any other active layers. Similarly, pressing the '2' bindkey should toggle the M2 metal layer, again without affecting the visibility of M1 or any other layers. When the same bindkey is pressed again, only the corresponding layer (e.g., M2 for '2') should be hidden, while all other layers remain unaffected.

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett 6 months ago

    You can use this code and call CCFsetToggleVisBindkeys(10) to set the bind keys:

    procedure(CCFtoggleVis(layerName @optional (purpose "drawing"))
      let(((lpp strcat(layerName " " purpose)))
        pteSetVisible(lpp !pteIsVisible(lpp))
      )
    )
    
    procedure(CCFsetToggleVisBindkeys(maxIndex @optional (prefix "M"))
      for(ind 1 maxIndex
        hiSetBindKey("Layout" 
          ; modulus allows 0 key to toggle M10; beyond that
          ; doesn't make sense as would overwrite the earlier layers
          lsprintf("<Key>%d" mod(ind 10))
          lsprintf("CCFtoggleVis(\"%s%d\")" prefix ind)
        )
      )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett 6 months ago

    You can use this code and call CCFsetToggleVisBindkeys(10) to set the bind keys:

    procedure(CCFtoggleVis(layerName @optional (purpose "drawing"))
      let(((lpp strcat(layerName " " purpose)))
        pteSetVisible(lpp !pteIsVisible(lpp))
      )
    )
    
    procedure(CCFsetToggleVisBindkeys(maxIndex @optional (prefix "M"))
      for(ind 1 maxIndex
        hiSetBindKey("Layout" 
          ; modulus allows 0 key to toggle M10; beyond that
          ; doesn't make sense as would overwrite the earlier layers
          lsprintf("<Key>%d" mod(ind 10))
          lsprintf("CCFtoggleVis(\"%s%d\")" prefix ind)
        )
      )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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