X Y coordinate list

Discussion in 'Cadence' started by PolyPusher, Mar 14, 2011.

  1. PolyPusher

    PolyPusher Guest

    Hi All,

    I have the following:

    enterPt = enterPoint(?prompts list("Enter Ruler Start Point."))
    startPt = geWindowToEditPoint(hiGetCurrentWindow() enterPt)

    when( startPt
    StartPtx = xCoord(startPt)
    StartPty = yCoord(startPt)
    )


    StartXY=list(StartPtx:StartPty))------->>>>>>>>>>>> not working!

    If StartPtx is 1 and StartPty is 2, the output I am looking for is
    coordinates
    1:2. This is to pass coordinates to SKILL that expects something
    like
    20.875:218.505. So really I don't want even a list.


    Thank you for any help inadvance,
    PolyPusher
     
    PolyPusher, Mar 14, 2011
    #1
  2. x:y is another syntax for (list x y), just slighly more conveniant to express
    coordinates. So your startPt can be passed to whatever expect
    20.875:218.505.

    Yours
     
    Jean-Marc Bourguet, Mar 14, 2011
    #2
  3. PolyPusher

    PolyPusher Guest

    In this case I am using a replay file and some code that explicitly
    needs x:y.

    Here is what I see in the transrcript file


    \i JPoverlapContact()
    \i 20.875:218.505

    So, I do need to know how to make 24:25 or whatever the numbers are.
    I tried to pass list(x y) and it doesn't accept the syntax.

    Thank you
    Eric
     
    PolyPusher, Mar 14, 2011
    #3
  4. PolyPusher wrote, on 03/14/11 14:15:
    Eric,

    You should be able to use StartPtx:StartPty or list(StartPtx StartPty) . I see
    no reason why either of those should not work. Your example has
    list(StartPtx:StartPty) which will be a list of a list - so that's probably not
    what you want.

    Regards,

    Andrew.
     
    Andrew Beckett, Mar 14, 2011
    #4
  5. What are you trying to do? Write a replay file to execute it after?

    Note that replay files isn't normal SKILL code and enter functions are
    also strange beasts (they start a new top level while keeping some state
    suspended, considering them as functions to which data can be fed will
    fail in some cases, there are some functions which can be called just
    *before* to set up things which would normally be given after, but
    either I've missed something or they usually don't allow to do what I
    want so trying to wrap them in a function with parameters will fail).

    Yours,
     
    Jean-Marc Bourguet, Mar 14, 2011
    #5
  6. If my guess is correct, try with:

    preXY(startPt)
    JPoverlapContact()

    (preXY is the function I was alluding to above, apparently, I
    misremembered that there were several functions of that kind)

    Yours,
     
    Jean-Marc Bourguet, Mar 14, 2011
    #6
  7. PolyPusher

    PolyPusher Guest

    I was getting confused, you were both correct that I did not need
    the : in between the x and y coordinates and the preXY works great.
    That is really cool. I am always amazed how many functions the public
    has access to and how quickly you guys try to help out us poly
    pushers.

    Thank you both very much,
    Eric
     
    PolyPusher, Mar 14, 2011
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.