• 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 SKILL
  3. Multiple press functions bind key

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 14348
  • 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

Multiple press functions bind key

RezaAMD
RezaAMD over 8 years ago

Hi,

I need to make a feature for a bind key in such a way that at the first press it turn on all M0 layers , at second press turn of some of the layers and at third press turn off all M0 layers.

M0 is just an example and I know how to create a normal bind key. I am using VIRTUOSO V12.3

Thanks.

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    I'd probably keep some kind of state variable (maybe as a variable, or maybe as a property on the window) so that you can have a function which essentially does something different in each of these states, and when you press the key it cycles around the value of the current state. It's easy enough. 

    Something like:

    MYlayerStates=makeTable('layerStates 0)
    procedure(MYcycleLayerDisplay(layerName)
      let((newState (allPurposes '("drawing" "label" "pin" "net")))
        newState=mod(MYlayerStates[layerName]+1 3)
        MYlayerStates[layerName]=newState
        case(newState
          (0 foreach(purpose allPurposes leSetLayerVisible(list(layerName purpose) nil)))
          (1 foreach(purpose allPurposes leSetLayerVisible(list(layerName purpose) t)))
          (2 foreach(purpose '("label" "net") leSetLayerVisible(list(layerName purpose) nil)))
        )
      )
    )

    Then you can put MYcycleLayerDisplay("M0") on your bindkey.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    I'd probably keep some kind of state variable (maybe as a variable, or maybe as a property on the window) so that you can have a function which essentially does something different in each of these states, and when you press the key it cycles around the value of the current state. It's easy enough. 

    Something like:

    MYlayerStates=makeTable('layerStates 0)
    procedure(MYcycleLayerDisplay(layerName)
      let((newState (allPurposes '("drawing" "label" "pin" "net")))
        newState=mod(MYlayerStates[layerName]+1 3)
        MYlayerStates[layerName]=newState
        case(newState
          (0 foreach(purpose allPurposes leSetLayerVisible(list(layerName purpose) nil)))
          (1 foreach(purpose allPurposes leSetLayerVisible(list(layerName purpose) t)))
          (2 foreach(purpose '("label" "net") leSetLayerVisible(list(layerName purpose) nil)))
        )
      )
    )

    Then you can put MYcycleLayerDisplay("M0") on your bindkey.

    Andrew.

    • 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