• 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. Creating a magic ruler

Stats

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

Creating a magic ruler

Adhil
Adhil over 13 years ago
Hi All!!! 1. i have always found it tedious to draw a ruler to double check layout parameters such as diff overlap past poly, when doing testchip layout. i want to design a code where when i run my cursor over or close to a side of an object (at the same level or at a lower hierarchy), the side gets highlighted. 2. after clicking, the coordinates of the side gets selected and when i do the same to a side of another object, a ruler is drawn from the first side to the second automatically. 3. this eliminates the need to zoom in and drag and draw a ruler. 4. i have used the gravity option, but i find it insufficient. please your advise and codes are most welcome, i am looking into dbgettrueoverlaps and other related skill functions. adhil
  • Cancel
Parents
  • dmay
    dmay over 13 years ago

    If you are already clicking twice, then setup one of your mouse keys to be a ruler bindkey. The following example uses Ctrl-mouse2 (hold down the control key, and press your middle mouse button to start the ruler and then do the same to finish your ruler):

    procedure(myMouseRuler()
      let((infix)
        cond(
            (hiGetCurrentCmd(hiGetCurrentWindow()) == "Ruler"
                mouseAddPt()
            )
            (!hiGetCurrentCmd(hiGetCurrentWindow())
                infix   = hiGetCIWindow()->infix
                hiGetCIWindow()->infix = t
                leHiCreateRuler()
                hiGetCIWindow()->infix = infix
            )
        )
      ) ;let
    ) ;proc
    hiSetBindKey("Layout" "Ctrl<Btn2Down>" "myMouseRuler()")
    hiSetBindKey("Layout" "Ctrl<Btn2Down> EF" "myMouseRuler()")

    You can enhance this further by adding gravity. Put these two lines before the leHiCreateRuler:
                gravity = envGetVal("layout" "gravityOn")
                envSetVal("layout" "gravityOn"      'boolean t)
    And restore the previous gravity setting after the leHiCreateRuler:
                envSetVal("layout" "gravityOn"      'boolean gravity)

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • dmay
    dmay over 13 years ago

    If you are already clicking twice, then setup one of your mouse keys to be a ruler bindkey. The following example uses Ctrl-mouse2 (hold down the control key, and press your middle mouse button to start the ruler and then do the same to finish your ruler):

    procedure(myMouseRuler()
      let((infix)
        cond(
            (hiGetCurrentCmd(hiGetCurrentWindow()) == "Ruler"
                mouseAddPt()
            )
            (!hiGetCurrentCmd(hiGetCurrentWindow())
                infix   = hiGetCIWindow()->infix
                hiGetCIWindow()->infix = t
                leHiCreateRuler()
                hiGetCIWindow()->infix = infix
            )
        )
      ) ;let
    ) ;proc
    hiSetBindKey("Layout" "Ctrl<Btn2Down>" "myMouseRuler()")
    hiSetBindKey("Layout" "Ctrl<Btn2Down> EF" "myMouseRuler()")

    You can enhance this further by adding gravity. Put these two lines before the leHiCreateRuler:
                gravity = envGetVal("layout" "gravityOn")
                envSetVal("layout" "gravityOn"      'boolean t)
    And restore the previous gravity setting after the leHiCreateRuler:
                envSetVal("layout" "gravityOn"      'boolean gravity)

    Derek

    • 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