• 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 15839
  • 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
  • zeroskills
    zeroskills over 15 years ago

    To How, Andrew, Derek and Rian - thanks for the help, i really appreciate it. so far, you've helped me with my request to be more productive at work.

    Riad-Initially copying your code to gotoxy.il, it is zoomed and does not have the "X" mark. i will test and look again and follow your comments.

    We don't have an in-house CAD support, we have to call/email CAD support to help us for things like this. With your help on my request, it have been very helpful and make me more productive at work. Thanks again.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kbhow
    kbhow over 15 years ago

    By the way, you can simply add a few lines in Riad's code to create the "X" mark using leCreateRuler

     How

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Satya
    Satya over 15 years ago

    Hi All!! I have modifide kbhow code to zoom and create x marker..please check it out!!

     

    procedure( ZoomToPoint( x y @key
     (scale 1)
     (winId hiGetCurrentWindow())
     (cvId geGetEditCellView()))

    let(( (dx 1) (dy 1) qcBbox)
    ;----------------------------
    ; Zoom to point with scale
    ;----------------------------
    hiZoomWindowAtPoint(winId scale x:y)
    printf("\nCmd: Zooming to Point %L %L with scale %L\n" x y scale)
    ;-------------------------------
    ; Create cross mark using ruler
    ;-------------------------------
    qcBbox = list( list( (x - dy) (y - dy)) list( (x + dx) (y + dx)))
    leCreateRuler( cvId list(x:y x+dx:y+dy))
    leCreateRuler( cvId list(x:y x+dx:y-dy))
    leCreateRuler( cvId list(x:y x-dx:y+dy))
    leCreateRuler( cvId list(x:y x-dx:y-dy))
    hiZoomIn(winId qcBbox)
      );let
     );proc
    procedure( zoomGUI()
     let(()
     ;----------------
     ; Create form
     ;----------------
    hiCreateAppForm(
    ?name 'zoomGui
    ?formTitle "Zoom and Mark"
    ?callback "zoomGuiCB(zoomGui->column->value)"
    ?fields list(
     list( hiCreateStringField(
     ?name 'column
     ?prompt "Go to:"
     ) 5:5 200:25 50)
     );
     ?buttonLayout 'OKCancel
     ?help ""
      );
    hiDisplayForm(zoomGui)
     );let
     );proc
    procedure( zoomGuiCB(input)
     let((dX dY (zscale 1))
     value = parseString(input " ")
     ;-----------------------
     ; Process form' value
     ;-----------------------
     if( length(value) == 2 then
     dX = atof(car(value))
     dY = atof(cadr(value))
     else
     if( length(value) == 3 then
    dX = atof(car(value))
    dY = atof(cadr(value))
    zscale = atof(caddr(value))
     else
    warn("Zoom to Pt => Invalid input! Input must be x y scale")
     );if
     );if
     ;--------------------------
     ; Calling function to zoom
     ;--------------------------
    ZoomToPoint(dX dY ?scale zscale)
    );let
    );proc
    hiSetBindKey("Layout" "Ctrl<Key>p" "zoomGUI()")

     

    Satya..

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Guruprasad S
    Guruprasad S over 10 years ago

    Hi , iam using this skill to zoom , but in this skill we need to enter x , y coordinates everytime.

    I have a set of 100 x , y coordinates , it must be given one after the other automatically by pressing NEXT button PREVIOUS botton ..

    (8.925,5.026)

    (0.586,4.256)

    (2.548,8.412)

       ....

      ....

       ...

    (4.568,2.195)

    Can any one suggest me how that can be done .




    procedure( zoomToPointFormCB(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)
        zoomToPointCB(point)
      )
    )
    ;---------------------------------------------------------------------------
    ; procedure : zoomToPointCB.
    ; This is the main function, it does dynamically calculate the
    ; zoom ratio and then pan. It also put the ref point that is displayed

    ;---------------------------------------------------------------------------
    procedure( zoomToPointCB(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))))
        ;The zoom can be made even higher, just by seeting value
         zoomVal=20*zoomVal
        hiPan( hiGetCurrentWindow() point)
        hiZoomRelativeScale(windowId  zoomVal)
        unless(leEditorOptionsForm->options->displayRefPoint->value
         leEditorOptionsForm->options->displayRefPoint->value=t
        )
        leSetRefPoint(windowId~>cellView point)
      )
    )
    ;---------------------------------------------------------------------------
    ; procedure : zoomToPoint, main entry.
    ;---------------------------------------------------------------------------
    procedure(zoomToPoint()
      unless(boundp('zoomToPointForm)
        zoomToPointCreateForm()
      )
      hiDisplayForm(zoomToPointForm)
    )
    ;---------------------------------------------------------------------------
    ; procedure : zoomToPointCreateForm
    ;---------------------------------------------------------------------------
    procedure(zoomToPointCreateForm()
      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("(zoomToPointFormCB " 'zoomToPointForm " )")
        )
                   
       zoomToPointForm=hiCreateAppForm(
          ?name 'zoomToPointForm
          ?formTitle " Zoom To Point"
          ?callback strcat("(zoomToPointFormCB " 'zoomToPointForm " )")
          ?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" "zoomToPoint()")

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • theopaone
    theopaone over 10 years ago

    Is your data in a file or a SKILL list? It looks like strings from a file.

    I would not use the form at all as it is harder to stuff the data in the form than process it directly. Write a function that gets the next value in the list, converts it to points (like zoomToPointFormCB) and calls zoomToPointCB.

    Use inFile to open the file, each time you read a line (lineread) you will get the next point represented as a string.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Guruprasad S
    Guruprasad S over 10 years ago

    Hi ,

    I have set of X Y Coordinates in a text file , that is " coordxy.txt "

    this fie has coordinates in the form of (X Y)

    1.2 6.8


    2.4 4.6


    6.2 2.9


    0.4 6.0


    5.0 8.9

    ....

    ....

    ....

    this is saved in file " coordxy.txt "

    I wrote another skill to load this "coordxy.txt " file in CIW and assigned it to  portt=infile(hiGetCurrentForm()->fileLocation->value)

    /*** Skill to load file in CIW **/

     procedure( loadfile()

        let( (fileLocation loadFileButton y)
            fileLocation = hiCreateFileSelectorField(
                    ?name           'fileLocation
                    ?mode           'existingFile
                    ?prompt         "Choose a file"
                    ?editable       t)

            loadFileButton = hiCreateButton(
                    ?name           'loadFileButton
                    ?buttonText     "Load File"
                    ?callback       "printf(\"Loading file from popup form %s\n\" myForm->fileLocation->value)")

            myForm = hiCreateAppForm(
                    ?name           'myForm
                    ?formTitle      "Load File in CIW"
                    ?buttonLayout   'Close
            ?dontBlock t    ; with this your previous code would have failed
                    ?fields         list( list(fileLocation 10:10 400:20 100)
                                            list(loadFileButton 415:10 80:30))
                    ?unmapAfterCB           t)

            hiDisplayForm(myForm)
        
        ); let
     port=infile(hiGetCurrentForm()->fileLocation->value)
    )

    hiSetBindKey("Layout" "Alt<key>L" "loadfile()")

    ----------------------END-----------------------

    Now i should read this file in CIW line by line, for this i have some code

    fpFile = infile(" 123.txt ")

    gets( line fpFile )

    tokens = parseString( line )

    rexCompile( "[xyXY] *[=:]")

    coord = rexReplace( line " " 0)

    rexCompile( "[(){}=,:]")

    coord = rexReplace( coord " " 0)

    rexCompile( "\\. ")

    coord = rexReplace( coord " " 0)

    coord = parseString(coord)

    coord=mapcar( 'aelNumber coord)

    coord=setof(x coord x)

    X=car(coord)

    Y=cadr(coord)

    -------------------------------------------------

    this will get value of X and Y from file line by line

    Next i need this values to assign in my main code one by one , by pressing NEXT BUTTON in pop up window , and it must go to previous line by Pressing PREVIOUS BUTTON .

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • theopaone
    theopaone over 10 years ago

    I would read in all the coordinates from the file and create an ordered list. Then the file could be closed.Parse the list using the nth command (index starts with 0). Create your own GUI, next would add one to the index, previous would subtract one.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Karthik Punna
    Karthik Punna over 6 years ago in reply to Satya

    Hi Satya,

    I'm using your code,

    But it showing an error while working on it i.e., too few arguments (at least 2expected , 1 given) - ((length ((value ==2)then (dx = atof(&)) (dy = atof(&))...))

    Could you please suggest me  how to fix the error .

    Regards,

    Karthik P.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to Karthik Punna

    You appear to have mangled the code somehow when copying and pasting it, and have added spaces in some places and probably removed them elsewhere. I copied the code and loaded it, and it worked fine. The error suggests that you have a space after the length function name (in SKILL in C-style you must not have a space between the function name and the following open parenthesis.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Karthik Punna
    Karthik Punna over 6 years ago in reply to Andrew Beckett

    Thank You , Andrew

    Karthik P.

    • 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