• 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. Print Cursor co-ordinates

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 142
  • Views 14480
  • 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

Print Cursor co-ordinates

bharath2k4er
bharath2k4er over 16 years ago

 Hi,

          I want to print the co-ordinates of the cursor pointer...for example: I have 5 clicks done in my layout. My output should be 5 co-ordinates written in a new file called "coord"

 

Pls give me some suggestions...

 

Thanks,

Bharath 

  • Cancel
  • Austin CAD Guy
    Austin CAD Guy over 16 years ago

     There are a couple of ways to do this:

     enterPoints - This enter function can prompt for points and use the callback to enter the information into a file.

     hiGetCommandPoint - gets the location of the pointer at the last click, place in a loop and as the user clicks the points, the points will be returned.

    3 - there are 3 ways to do this:

     hiGetPoint - Gets the current xy location of the cursor. Does not need a mouse click.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 16 years ago

    Hi Bharath,

    In addition to what Ted has said, you will also probably want to use the outfile(), fprintf() and close()  SKILL functions for opening, writing to and closing the file respectively. Assuming that the variable coordlist contains the coordinates gathered from the layout, you might do something like the following:

    when(fptr = outfile("coord")
     foreach(coord coordlist
       fprintf(fptr "%L" coord)
     )
     close(fptr)
    ); when the file can be opened for writing

    Best regards,

    Lawrence.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • kbhow
    kbhow over 16 years ago

    Hi Bharath,

    I believe this script may helps.

     

    procedure( GetCursorCoord( @key

    (numbOfPoints 5)

    (fileName "CursorCoord.log"))

    let((messages pt fp)

     

    ;-----------------------------------

    ; Create a message to prompts

    ;-----------------------------------

    for( i 1 5

    messages = cons(sprintf(nil "Enter %d point" i) messages)

    )

     

    ;-----------------------------------

    ; Get enter points from user

    ;-----------------------------------

    points = enterPoints(

    ?prompts reverse(messages)

    ?wantPoints numbOfPoints

    )

     

    ;--------------------------------------

    ; Write the coordinate to a file

    ;--------------------------------------

    if( (fp = outfile(fileName)) then

    foreach( pt points

    fprintf(fp "Coord -> %L" pt)

    )

    close(fp)

    else

    warn("Failed to open file %L\n" fileName)

    )

    );let

    );proc

     

    Regards,

    How

    • 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