• 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. Message with timeout in graphic editor (layout, schematic...

Stats

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

Message with timeout in graphic editor (layout, schematic)

patschouly
patschouly over 5 years ago

I have some keybindings for changing layers, grid etc. in layout and schematic. I would like to get some visual feedback what setting I switched to (for instance the grid spacing). I tried to do this with hiDisplayAppDBox, but this creates a dialog that I have to dismiss, which is a nuisance. Is there a way to draw directly on the canvas (e.g. as the "Selection Hint" does)? This message should disappear after some seconds or after the canvas is moved.

Here is my current approach:

procedure(SetGridSnapSpacing(snap)
    let( (cv)
        cv = hiGetCurrentWindow()
        cv~>xSnapSpacing = snap
        cv~>ySnapSpacing = snap
        cv~>gridSpacing = snap
        cv~>gridMultiple = 5
        hiDisplayAppDBox(?name gensym("dummy") ?dboxText sprintf(nil "Snap pattern changed to %g" snap) ?buttonLayout 'Close ?dialogType hicInformationDialog)
    ) ; let
)

Thanks in advance, kind regards,

Patrick

  • Cancel
Parents
  • dmay
    dmay over 5 years ago

    You could create a highlight label that appears over the layout at the current zoom location and then use the hiRegTimer to clear the highlight after a few seconds. The size of the label should be made relative to the size of the current view area so that it is visible and readable whether you are zoomed way in or way out. 

    curWinCoordBox = geGetWindowBox(hiGetCurrentWindow())

    Here is an example of creating a highlight label:

    https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nVwQEAU&pageName=ArticleContent

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • patschouly
    patschouly over 5 years ago in reply to dmay

    Thanks to you both, that was very helpful!

    Here is my current solution, it works well:

    procedure(SetGridSnapSpacing(snap)
        let( (cv winBox y1 y2)
            cv = hiGetCurrentWindow()
            cv~>xSnapSpacing = snap
            cv~>ySnapSpacing = snap
            cv~>gridSpacing = snap
            cv~>gridMultiple = 5

            ; create label hilight
            geDeleteHilightSet(SetGridSnapSpacing.hlset) ; first, delete the old hilight
            cv = geGetEditCellView()
            winBox = hiGetViewBBox()
            y1 = cadar(winBox)
            y2 = cadadr(winBox)
            textSize = (y2 - y1) / 40
            SetGridSnapSpacing.hlset = geCreateHilightSet(cv list("hilite" "drawing1"))
            SetGridSnapSpacing.hlset->enable = t
            geAddHilightLabel(
                SetGridSnapSpacing.hlset
                hiGetPoint(hiGetCurrentWindow())
                lsprintf("Grid Snap Spacing: %.3f" snap)
                "lowerLeft" "R0" "roman" textSize t nil
            ) ; geAddHilightLabel
            hiRegTimer("geDeleteHilightSet(SetGridSnapSpacing.hlset)" 5)
        ) ; let
    )

    procedure(CycleGridSnapSpacing()
        case( gridMode
            ( 1 SetGridSnapSpacing(0.001))
            ( 2 SetGridSnapSpacing(0.01))
            ( 3 SetGridSnapSpacing(0.1))
            ( 4 SetGridSnapSpacing(1.0))
            ( 5 SetGridSnapSpacing(5.0))
            ( 6 SetGridSnapSpacing(10.0))
        )   
        gridMode = mod(gridMode 6) + 1
    )

    I'm always deleting the old hilightset before drawing the new one. This works fine, but I'm getting the following warning, which I don't understand:

    *WARNING* (GE-2144): The parameter hl:invalid is not a hilight set Id. Provide a valid hilight set Id.

    What am I doing wrong?

    Kind regards,

    Patrick

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • patschouly
    patschouly over 5 years ago in reply to dmay

    Thanks to you both, that was very helpful!

    Here is my current solution, it works well:

    procedure(SetGridSnapSpacing(snap)
        let( (cv winBox y1 y2)
            cv = hiGetCurrentWindow()
            cv~>xSnapSpacing = snap
            cv~>ySnapSpacing = snap
            cv~>gridSpacing = snap
            cv~>gridMultiple = 5

            ; create label hilight
            geDeleteHilightSet(SetGridSnapSpacing.hlset) ; first, delete the old hilight
            cv = geGetEditCellView()
            winBox = hiGetViewBBox()
            y1 = cadar(winBox)
            y2 = cadadr(winBox)
            textSize = (y2 - y1) / 40
            SetGridSnapSpacing.hlset = geCreateHilightSet(cv list("hilite" "drawing1"))
            SetGridSnapSpacing.hlset->enable = t
            geAddHilightLabel(
                SetGridSnapSpacing.hlset
                hiGetPoint(hiGetCurrentWindow())
                lsprintf("Grid Snap Spacing: %.3f" snap)
                "lowerLeft" "R0" "roman" textSize t nil
            ) ; geAddHilightLabel
            hiRegTimer("geDeleteHilightSet(SetGridSnapSpacing.hlset)" 5)
        ) ; let
    )

    procedure(CycleGridSnapSpacing()
        case( gridMode
            ( 1 SetGridSnapSpacing(0.001))
            ( 2 SetGridSnapSpacing(0.01))
            ( 3 SetGridSnapSpacing(0.1))
            ( 4 SetGridSnapSpacing(1.0))
            ( 5 SetGridSnapSpacing(5.0))
            ( 6 SetGridSnapSpacing(10.0))
        )   
        gridMode = mod(gridMode 6) + 1
    )

    I'm always deleting the old hilightset before drawing the new one. This works fine, but I'm getting the following warning, which I don't understand:

    *WARNING* (GE-2144): The parameter hl:invalid is not a hilight set Id. Provide a valid hilight set Id.

    What am I doing wrong?

    Kind regards,

    Patrick

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • dmay
    dmay over 5 years ago in reply to patschouly

    If the highlight set has already been deleted, or if it has not yet been created for the first time, then you'll get that message. You can check the highlight set before deleting it:

    when(geIsValidHilightSet(SetGridSnapSpacing.hlset)
            geDeleteHilightSet(SetGridSnapSpacing.hlset) ; first, delete the old hilight
    )

    Derek

    • 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