• 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. Store recall layout editor view positions

Stats

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

Store recall layout editor view positions

blankman
blankman over 14 years ago

Hi all,

I am hoping to store and recall viewing positions in layout editor. I am taking the window bounding box from the layout view with geGetWindowBox(), which gives 2 coordinates. This stores the xy position and zoom level of the layout editor automatically. I am hoping to use these coordinates again to set the layout view position but can't locate a suitable command to do so. Is it possible? Something along the lines of geSetWindowBox() would sort it but doesn't seem to exist.

Thanks,
Brian.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Brian,

    hiZoomIn is what you want. The second argument to hiZoomIn is the box you want to zoom to.

    However, isn't this the same as View->Save/Restore that's in the tools already (for as long as I can remember)? In IC5141 it was under Window->Utilities->Save/Restore View.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

    Ah, cheers Andrew, I didn't see hiZoomIn. That sorted it out. Handy to know the Utilities route too. I'll have to take a closer look at the menu options.
    Rgds,
    Brian.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

    Andrew, another quick question, below is the code I am using. However, when I execute the second procedure without having executed the first the variable wid1 is undefined and I get an error message "unbound variable wid1". Is there anyway around this, say to check if a variable is yet defined and if not to exit the function or execute another function?

    Thanks,

    Brian.

     

     procedure(BSstoreView1()
        wid1=geGetWindowBox(hiGetCurrentWindow())
        sprintf(message "View 1 stored\n")
        when(message
                            win=geGetEditCellViewWindow(geGetEditCellView())
                            point=hiGetPoint(win)
                            geDeleteAllHilightSet(geGetWindowCellView())
                            ;Set label size depending on window zoom
                                    x2 = xCoord(cadr(geGetWindowBox(hiGetCurrentWindow())))
                                    x1 = xCoord(car(geGetWindowBox(hiGetCurrentWindow())))
                                    dx = x2 - x1
                                    labelheight = dx/100
                            when(point
                                    hs=geCreateHilightSet(geGetWindowCellView()
                                            abDynamicDisplay.lpp || '("y4" "drawing"))
                                    geAddHilightLabel(
                                            hs
                                            point
                                            message
                                            abDynamicDisplay.justify || "centerCenter"
                                            abDynamicDisplay.orient || "R0"
                                            abDynamicDisplay.font || "roman"
                                            abDynamicDisplay.height || labelheight
                                            nil
                                    )
                                    hs->enable=t
                                    geRefresh()
                                    hiRegTimer("geDeleteAllHilightSet(geGetWindowCellView()) geRefresh()" 25)
                            )
                    )
            message = nil
    );procedure
    hiSetBindKey("Layout" "Ctrl Shift<key>KP_Home" "BSstoreView1()")


    procedure(BSreselectView1()
        win=geGetEditCellViewWindow(geGetEditCellView())
        hiZoomIn(win wid1)
        sprintf(message "View 1 selected\n")
        when(message

                            win=geGetEditCellViewWindow(geGetEditCellView())
                            point=hiGetPoint(win)
                            geDeleteAllHilightSet(geGetWindowCellView())
                            ;Set label size depending on window zoom
                                    x2 = xCoord(cadr(geGetWindowBox(hiGetCurrentWindow())))
                                    x1 = xCoord(car(geGetWindowBox(hiGetCurrentWindow())))
                                    dx = x2 - x1
                                    labelheight = dx/100
                            when(point
                                    hs=geCreateHilightSet(geGetWindowCellView()
                                            abDynamicDisplay.lpp || '("y4" "drawing"))
                                    geAddHilightLabel(
                                            hs
                                            point
                                            message

                                            abDynamicDisplay.justify || "centerCenter"
                                            abDynamicDisplay.orient || "R0"
                                            abDynamicDisplay.font || "roman"
                                            abDynamicDisplay.height || labelheight
                                            nil
                                    )
                                    hs->enable=t
                                    geRefresh()
                                    hiRegTimer("geDeleteAllHilightSet(geGetWindowCellView()) geRefresh()" 25)
                            )
                    )
        message = nil
    );procedure
    hiSetBindKey("Layout" "Ctrl<key>KP_Home" "BSreselectView1()")

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    Hi Brian,

    Yes, use:

    when(boundp('wid1)
      ...
    )

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    By the way, I'd really recommend you give any global variables a sensible prefix so that they don't clash with other things.  We generally recommend customers using a prefix which begins with uppercase - so BrianWid1 would a better name ;-)

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 14 years ago

     Perfect, thanks andrew. I had tried the boundp command alright, only I was missing the ' for the list. Sorted now. I'll make sure and use more suitable prefixes too, or local variables where possible, I have noticed sometimes programs affecting the operation of Cadence, this may well have been the reason :)
    Brian

    • 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