• 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. Toggle a grid switch

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 12935
  • 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

Toggle a grid switch

Michael Kolesnik
Michael Kolesnik over 4 years ago

Should be easy, but can't figure out where it is wrong.

Lint score is 100.

Tried "nil" with and without quotes.

Purpose = Toggle the fb1 grid on or off with a bindkey.

Flow:

1. get grid visible status.

2. if on then turn off.

3. if off then turn on.

Problem: Turns it off but won't toggle it on.

code starts here:

procedure(MDTtoggleFB1( )
if( pteIsVisible("Grids;Snap Patterns;Local Grids;fb1" "Grids") == "nil"
then
pteSetVisible("Grids;Snap Patterns;Local Grids;fb1" t "Grids")
else
pteSetVisible("Grids;Snap Patterns;Local Grids;fb1" nil "Grids")
)
)

  • Cancel
Parents
  • skillUser
    skillUser over 4 years ago

    Hi Mike,

    You could try this, it worked for me:

    pteSetVisible("Grids;Snap Patterns;Local Grids;fb1" !pteIsVisible("Grids;Snap Patterns;Local Grids;fb1" "Grids") "Grids")

    Cheers,

    Lawrence.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • skillUser
    skillUser over 4 years ago

    Hi Mike,

    You could try this, it worked for me:

    pteSetVisible("Grids;Snap Patterns;Local Grids;fb1" !pteIsVisible("Grids;Snap Patterns;Local Grids;fb1" "Grids") "Grids")

    Cheers,

    Lawrence.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • Michael Kolesnik
    Michael Kolesnik over 4 years ago in reply to skillUser

    Fantastic! works exactly as intended. Thanks for the very quick response. Any idea on my coding error? I want to avoid that in the future. I also have another function I am workin on and wonder if you can give some hints. Here is what it does:

    1. Select a clone and it highlights with arcs (like the schematic arc highlighting) all of the same clones.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 4 years ago in reply to Michael Kolesnik

    I couldn't see anything obvious, perhaps a (double) quote got converted into a 'left quote' or 'right quote' and this prevented Virtuoso from understanding the string as being complete - this happens when copy-pasting from other sources (e.g. email)...

    You would need to share the code for anyone on the Forum to be able to help with the second coding endeavor.

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to skillUser

    What was wrong was that the nil to the right of the == should not have been in quotes (it's not a string, so it doesn't make sense to do that). It should be:

    procedure(MDTtoggleFB1( )
    if( pteIsVisible("Grids;Snap Patterns;Local Grids;fb1" "Grids") == nil
    then
    pteSetVisible("Grids;Snap Patterns;Local Grids;fb1" t "Grids")
    else
    pteSetVisible("Grids;Snap Patterns;Local Grids;fb1" nil "Grids")
    )
    )

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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