Home > Community > Forums > Custom IC SKILL > Need the X:Y co-ordinates of the point

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: *

 Need the X:Y co-ordinates of the point 

Last post Mon, Jun 8 2009 1:46 PM by Andrew Beckett. 12 replies.
Started by Chin Cypress 02 Jun 2009 08:46 AM. Topic has 12 replies and 4106 views
Page 1 of 1 (13 items)
Sort Posts:
  • Tue, Jun 2 2009 8:46 AM

    • Chin Cypress
    • Not Ranked
    • Joined on Tue, Jun 2 2009
    • Hyderabad, Andhra Pradesh
    • Posts 8
    • Points 160
    Need the X:Y co-ordinates of the point Reply

    Hello all

              I need the x:y co-ordinates of the point where i clicked in the layout editor window.

    Requirement : need to get the points and print in to the file.

     Please suggest the command to be used ASAP

    Rgds

    Chin 

    Rgds Chin
    Filed under:
    • Post Points: 35
  • Tue, Jun 2 2009 8:54 AM

    Re: Need the X:Y co-ordinates of the point Reply

    Is this some University project? This sounds remarkably like https://www.cadence.com/Community/forums/p/12606/18010.aspx#18010 posted a few minutes ago.

    Andrew.

    • Post Points: 35
  • Tue, Jun 2 2009 8:58 AM

    Re: Need the X:Y co-ordinates of the point Reply

     My response from another post:

    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: 20
  • Tue, Jun 2 2009 9:09 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,587
    • Points 15,915
    Re: Need the X:Y co-ordinates of the point Reply

    Hi,

    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.

    Best regards,

    Lawrence.

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

    • Chin Cypress
    • Not Ranked
    • Joined on Tue, Jun 2 2009
    • Hyderabad, Andhra Pradesh
    • Posts 8
    • Points 160
    Re: Need the X:Y co-ordinates of the point Reply

     No. its not the university project. we both are friends but without notice bharath also raised the issue. 

    Please reply for this alone. Thanks Bracknell for pointing.

     

    Rgds

    Chin 

    Rgds Chin
    • Post Points: 20
  • Tue, Jun 2 2009 5:21 PM

    • kbhow
    • Top 75 Contributor
    • Joined on Thu, May 7 2009
    • Penang, Pulau Pinang
    • Posts 120
    • Points 2,045
    Re: Need the X:Y co-ordinates of the point Reply

    Hi Chin,

    Haha... looks like you and Bharath is lookign for same coding. Probably is some assignment or task. You may refer to Bharath post.

     Regards,

    How 

    • Post Points: 5
  • Wed, Jun 3 2009 1:57 AM

    • Chin Cypress
    • Not Ranked
    • Joined on Tue, Jun 2 2009
    • Hyderabad, Andhra Pradesh
    • Posts 8
    • Points 160
    Re: Need the X:Y co-ordinates of the point Reply

    Hi

       Out of your 3 ways choosen one.Can u suggest there is any syntax problem in the follwoing code.

    Please correct the code & post. 

    cvid = geGetEditCellView()
    coordlist = hiGetCommandPoint(cvid)

    printf("co-ordinate is  = %d" coordlist)

     Rgds

    Chin 

    Rgds Chin
    • Post Points: 20
  • Wed, Jun 3 2009 2:15 AM

    Re: Need the X:Y co-ordinates of the point Reply

    Did you actually try this? If  you try it, you'll get error messages which make it very clear. For example, when you try to pass a cellView id to hiGetCommandPoint, it says:

    *Error* hiGetCommandPoint: argument #1 should be a window type (type template = "w") - db:202165292

    If you read the manual for this function, that is also clear. So something like:

    coordlist=hiGetCommandPoint()

    would do it. However, this would need to be triggered by a bindkey, because if you just type it in the CIW, the cursor would have left the window, and hence it will return  nil.

    The next problem is that you're trying to do use %d to print a list. %L would be better - %d will give an error because the return value of the function is not an integer.

    So if you do:

    procedure(MYgetPoint()
      let((coord)
        coord=hiGetCommandPoint()
        printf("Point was %L\n" coord)
      )
    )

    hiSetBindKey("Layout" "<Key>x" "MYgetPoint()")

    It will work.

    It may be your English, but people will be more willing to help if you appear to have tried to figure it out yourself, explaining what you tried, what the errors were and so on. As it is, your post looks more like "please do my work for me"...

    Regards,

    Andrew.

    • Post Points: 20
  • Mon, Jun 8 2009 8:31 AM

    • Chin Cypress
    • Not Ranked
    • Joined on Tue, Jun 2 2009
    • Hyderabad, Andhra Pradesh
    • Posts 8
    • Points 160
    Re: Need the X:Y co-ordinates of the point Reply

    Hi Andrew

                   Sure i will correct my way of approach.But sincerly I worked on it and got the errors then only posted to the community.

    I  further worked on the script for the development purpose and got struck at a point.

    The requirement is to pass the value "coord" to the   procedure(ABcursorPoint().

    But error flasing as "*Error* eval: unbound variable - coord" . Please suggest any other way to approach the problem.

    Rgds

    Chin 

     

     

    /**************************************************************
    *                 Prints the x y coordinate                   *
    * loaded in the variable in the coord                         *
    ***************************************************************/
    cvid = geGetEditCellView()

    procedure(MYgetPoint()
      let((coord)
        coord=hiGetCommandPoint()
        printf("%L\n" coord)
         )
    )

    procedure(ABcursorPoint()
             (leZoomToPoint cvid coord)
    )


    hiSetBindKey("Layout" "t" "MYgetPoint()")
    hiSetBindKey("Layout" "Shift<Key>t" "ABcursorPoint()")
     

    Rgds Chin
    • Post Points: 20
  • Mon, Jun 8 2009 9:51 AM

    Re: Need the X:Y co-ordinates of the point Reply
    procedure(ABcursorPoint()  
    leZoomToPoint(
    geGetEditCellView()
    hiGetCommandPoint()
    )
    )

    Should do it. I didn't test this as I'm sending this from an airport lounge...

    Regards,

    Andrew
    • Post Points: 20
  • Mon, Jun 8 2009 10:25 AM

    • Chin Cypress
    • Not Ranked
    • Joined on Tue, Jun 2 2009
    • Hyderabad, Andhra Pradesh
    • Posts 8
    • Points 160
    Re: Need the X:Y co-ordinates of the point Reply

    Thanks for your extra effort andrew..:)

      I have tried working on your suggestion,but i found other errors,..

    \a MYgetPoint()
    \i 8.71:64.43
    \o (8.71 64.43)
    \r t
    \a ABcursorPoint()
    \i 8.065:61.91
    \o *** Error in routine leZoomToPoint:
    \o Message: *Error* leZoomToPoint: argument #1 should be a window type (type template = "wl") - db:-2072629204

         

                I will take you throught the actual requirement behind this, so that you can guide us in a better way..The requirement goes like this,

    1.We are trying to copy a xy co-ordinate by pressing a bindkey 't' from layout window 1 

    2.With the help of this co-ordinate we are pointing to exactly same location in layout window   '2' by pressing a bindkey 'shift<t>'

             Please suggest us the correct way to proceed further..

    Regards,

    --Chin 

      

      

     

    Rgds Chin
    • Post Points: 20
  • Mon, Jun 8 2009 11:57 AM

    Re: Need the X:Y co-ordinates of the point Reply
    Sorry - I didn't read the manual for leZoomToPoint - I was just taking your code as a starting point; I shouldn't have assumed it was correct.

    Now that you've explained your requirement - which would have been the best thing to do in the first place, as it is now obvious what you're trying to do.

    I have some SKILL code which does what you want - or similar - albeit in a rather different way. I'll post it later when I've got a proper connection.

    Regards,

    Andrew
    • Post Points: 5
  • Mon, Jun 8 2009 1:46 PM

    Re: Need the X:Y co-ordinates of the point Reply

    Here's the code. Define a bindkey which calls abCopyWinView() . When you press the bindkey it will prompt you to pick two windows (source and destination) - or just destination if you have infix on - and will copy the zoom position from one window to the other.

    Regards,

    (procedure (abCopyWinViewCB win done points)
      (let (bbox)
           (setq win (hiGetCurrentWindow))
           (when (and done (windowp win) (windowp abCopyWinViewFrom))
                 (setq bbox (hiGetViewBBox abCopyWinViewFrom))
                 (hiZoomIn win bbox))))
    
    /***************************************************************
    *                                                              *
    *             (abCopyWinView @optional (win nil))              *
    *                                                              *
    *     Procedure to copy a view from one window to another      *
    *                                                              *
    ***************************************************************/
    
    (procedure (abCopyWinView @optional (win nil))
      (unless win (setq win (hiGetCurrentWindow)))
      (setq abCopyWinViewFrom win)
      (hiSetCurrentWindow win)
      (when (windowp win)
            (enterMultiRep ?prompts '("Point to the source window" "Point to the destination window")
                           ?points '((0 0))
                           ?doneProc "abCopyWinViewCB"
                           ?dontDraw t
                           ))
      t)
    

    Andrew.

    • Post Points: 5
Page 1 of 1 (13 items)
Sort Posts:
Started by Chin Cypress at 02 Jun 2009 08:46 AM. Topic has 12 replies.