• 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. help - skill code for goto xy coordinate

Stats

  • Locked Locked
  • Replies 23
  • Subscribers 146
  • Views 15830
  • 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

help - skill code for goto xy coordinate

zeroskills
zeroskills over 15 years ago

i would like some help on skill code for goto xy coordinate. we used to have this skill code, it does this...

pop up goto xy form, just input x and y coordinate then view size, like how zoom in or out you want it. then there will be an "X" ruler mark on the coordinate.

 

  • Cancel
Parents
  • Riad KACED
    Riad KACED over 15 years ago

    Hi Guys,

    I'm jumping a bit late into the subject but wanted to share some code I have written based on what discussed here.

    The above code has the added value of self-calculating the 'right' zoom ratio before applying the pan function. This code calcules a zoom that would magnify the design into a window size les than 1um^2, assuming the initial design is more than 1um*1um.One can make this code zooming even more if needed, just by adding a multiplier as explained within the code.


    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPointFormCB
    ;---------------------------------------------------------------------------
    procedure( RKzoomToPointFormCB(form)
      let((point xCoordinate yCoordinate)
        xCoordinate=car(parseString(form->xyCoordinates->value ","))
        yCoordinate=cadr(parseString(form->xyCoordinates->value ","))
        point=list(cdfParseFloatString(xCoordinate) cdfParseFloatString(yCoordinate))
        printf("The Selected Point is: %L\n" point)
        RKzoomToPointCB(point)
      )
    )
    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPointCB.
    ; This is actually the main function, it does dynamically calculate the
    ; zoom ratio and then pan. It also put the ref point that is displayed
    ; if users setup their environment to do so.
    ;---------------------------------------------------------------------------
    procedure( RKzoomToPointCB(point)
      let((windowId viewBBox zoomVal)
        windowId=hiGetCurrentWindow()
        hiZoomAbsoluteScale(windowId 1)
        viewBBox=hiGetViewBBox(windowId)
        zoomVal=max(abs(yCoord(upperRight(viewBBox))-yCoord(lowerLeft(viewBBox)))
                    abs(xCoord(upperRight(viewBBox))-xCoord(lowerLeft(viewBBox))))
        ; One can make the zoom even higher, just by seeting
        ; something like
        ; zoomVal=10*zoomVal for example
        hiPan( hiGetCurrentWindow() point)
        hiZoomRelativeScale(windowId  zoomVal)
        ;unless(leEditorOptionsForm->options->displayRefPoint->value
        ;  leEditorOptionsForm->options->displayRefPoint->value=t
        ;)
        leSetRefPoint(windowId~>cellView point)
      )
    )
    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPoint, main entry.
    ;---------------------------------------------------------------------------
    procedure(RKzoomToPoint()
      unless(boundp('RKzoomToPointForm)
        RKzoomToPointCreateForm()
      )
      hiDisplayForm(RKzoomToPointForm)
    )
    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPointCreateForm
    ;---------------------------------------------------------------------------
    procedure(RKzoomToPointCreateForm()
      let((xyCoordinates zoomLabel zoomButton)
       
        zoomLabel=hiCreateLabel(
          ?name 'zoomLabel
          ?labelText "enter ',' separated points: ex 0.0,0.0"
          ?justification `center
        )
      
        xyCoordinates=hiCreateStringField(
          ?name 'xyCoordinates
          ?prompt "X,Y Coordinates"
          ?value "0.0,0.0"
        )           
        zoomButton=hiCreateButton(
          ?name 'zoomButton
          ?buttonText "Zoom & Pan"
          ?callback strcat("(RKzoomToPointFormCB " 'RKzoomToPointForm " )")
        )
                   
       RKzoomToPointForm=hiCreateAppForm(
          ?name 'RKzoomToPointForm
          ?formTitle "RK Zoom To Point"
          ?callback strcat("(RKzoomToPointFormCB " 'RKzoomToPointForm " )")
          ?buttonLayout '(OKCancelDef)
          ?fields list(
            list(zoomLabel 5:5 250:30 100 )
            list(xyCoordinates 5:40 250:30 100 )
        list(zoomButton  30:75 200:30  )
          )
        )
      )
    )
    ;---------------------------------------------------------------------------
    ; Bindkey definition
    ;---------------------------------------------------------------------------
    hiSetBindKey("Layout" "Alt<Key>z" "RKzoomToPoint()")

     

     

    Cheers,

    Riad. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Riad KACED
    Riad KACED over 15 years ago

    Hi Guys,

    I'm jumping a bit late into the subject but wanted to share some code I have written based on what discussed here.

    The above code has the added value of self-calculating the 'right' zoom ratio before applying the pan function. This code calcules a zoom that would magnify the design into a window size les than 1um^2, assuming the initial design is more than 1um*1um.One can make this code zooming even more if needed, just by adding a multiplier as explained within the code.


    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPointFormCB
    ;---------------------------------------------------------------------------
    procedure( RKzoomToPointFormCB(form)
      let((point xCoordinate yCoordinate)
        xCoordinate=car(parseString(form->xyCoordinates->value ","))
        yCoordinate=cadr(parseString(form->xyCoordinates->value ","))
        point=list(cdfParseFloatString(xCoordinate) cdfParseFloatString(yCoordinate))
        printf("The Selected Point is: %L\n" point)
        RKzoomToPointCB(point)
      )
    )
    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPointCB.
    ; This is actually the main function, it does dynamically calculate the
    ; zoom ratio and then pan. It also put the ref point that is displayed
    ; if users setup their environment to do so.
    ;---------------------------------------------------------------------------
    procedure( RKzoomToPointCB(point)
      let((windowId viewBBox zoomVal)
        windowId=hiGetCurrentWindow()
        hiZoomAbsoluteScale(windowId 1)
        viewBBox=hiGetViewBBox(windowId)
        zoomVal=max(abs(yCoord(upperRight(viewBBox))-yCoord(lowerLeft(viewBBox)))
                    abs(xCoord(upperRight(viewBBox))-xCoord(lowerLeft(viewBBox))))
        ; One can make the zoom even higher, just by seeting
        ; something like
        ; zoomVal=10*zoomVal for example
        hiPan( hiGetCurrentWindow() point)
        hiZoomRelativeScale(windowId  zoomVal)
        ;unless(leEditorOptionsForm->options->displayRefPoint->value
        ;  leEditorOptionsForm->options->displayRefPoint->value=t
        ;)
        leSetRefPoint(windowId~>cellView point)
      )
    )
    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPoint, main entry.
    ;---------------------------------------------------------------------------
    procedure(RKzoomToPoint()
      unless(boundp('RKzoomToPointForm)
        RKzoomToPointCreateForm()
      )
      hiDisplayForm(RKzoomToPointForm)
    )
    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPointCreateForm
    ;---------------------------------------------------------------------------
    procedure(RKzoomToPointCreateForm()
      let((xyCoordinates zoomLabel zoomButton)
       
        zoomLabel=hiCreateLabel(
          ?name 'zoomLabel
          ?labelText "enter ',' separated points: ex 0.0,0.0"
          ?justification `center
        )
      
        xyCoordinates=hiCreateStringField(
          ?name 'xyCoordinates
          ?prompt "X,Y Coordinates"
          ?value "0.0,0.0"
        )           
        zoomButton=hiCreateButton(
          ?name 'zoomButton
          ?buttonText "Zoom & Pan"
          ?callback strcat("(RKzoomToPointFormCB " 'RKzoomToPointForm " )")
        )
                   
       RKzoomToPointForm=hiCreateAppForm(
          ?name 'RKzoomToPointForm
          ?formTitle "RK Zoom To Point"
          ?callback strcat("(RKzoomToPointFormCB " 'RKzoomToPointForm " )")
          ?buttonLayout '(OKCancelDef)
          ?fields list(
            list(zoomLabel 5:5 250:30 100 )
            list(xyCoordinates 5:40 250:30 100 )
        list(zoomButton  30:75 200:30  )
          )
        )
      )
    )
    ;---------------------------------------------------------------------------
    ; Bindkey definition
    ;---------------------------------------------------------------------------
    hiSetBindKey("Layout" "Alt<Key>z" "RKzoomToPoint()")

     

     

    Cheers,

    Riad. 

    • 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