Home > Community > Forums > Custom IC SKILL > Print Cursor co-ordinates

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Print Cursor co-ordinates 

Last post Tue, Jun 2 2009 5:17 PM by kbhow. 3 replies.
Started by bharath2k4er 02 Jun 2009 08:44 AM. Topic has 3 replies and 1299 views
Page 1 of 1 (4 items)
Sort Posts:
  • Tue, Jun 2 2009 8:44 AM

    • bharath2k4er
    • Top 500 Contributor
    • Joined on Wed, Feb 11 2009
    • blr, Karnataka
    • Posts 34
    • Points 650
    Print Cursor co-ordinates Reply

     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 

    Thanks, Bharath
    • Post Points: 35
  • Tue, Jun 2 2009 8:50 AM

    Re: Print Cursor co-ordinates Reply

     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.

    • Post Points: 5
  • Tue, Jun 2 2009 9:15 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,538
    • Points 15,030
    Re: Print Cursor co-ordinates Reply

    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.
    • Post Points: 20
  • Tue, Jun 2 2009 5:17 PM

    • kbhow
    • Top 50 Contributor
    • Joined on Thu, May 7 2009
    • Penang, Pulau Pinang
    • Posts 120
    • Points 2,045
    Re: Print Cursor co-ordinates Reply

    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

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by bharath2k4er at 02 Jun 2009 08:44 AM. Topic has 3 replies.