How to get the coordinates of a line/ edge of rectangle

Discussion in 'Cadence' started by SS, Nov 30, 2005.

  1. SS

    SS Guest

    Hi,
    I would like to know how to get the coordinates of an edge of a
    rectangle that is selected(which is a line).

    I can get the coordinates of the BBox. But this wont help me since
    I need to know which side of the BBox is selected .

    can anyone help me out.

    thanks,
    Sriram
     
    SS, Nov 30, 2005
    #1
  2. geGetSelSetFigPoint() is the function you want. This will tell you which points
    on an object are selected.

    Andrew.
     
    Andrew Beckett, Dec 1, 2005
    #2
  3. Andrew,
    obj = car(geGetSelSet())
    mapcar('and geGetSelSetFigPoint(obj) obj->points)
    => *Error* eval: not a function - 57.0

    However, the following code works,

    mapcar(lambda((a b) and(a b)) geGetSelSetFigPoint(obj) obj->points)
    => ((57.0 1587.6) (57.0 1062.45) nil nil nil nil nil nil)

    Whats the difference between the two?

    regards,
    Suresh
     
    Suresh Jeevanandam, Dec 1, 2005
    #3
  4. SS

    SS Guest

    Andrew and Suresh,
    Thanks
     
    SS, Dec 1, 2005
    #4
  5. The issue is that and() is a syntax form, which selectively evaluates its
    arguments depending on the value of the previous argument. In fact that's one of
    the real benefits of and()!

    What is happening here is that mapcar is collecting a value from each of
    the lists, that is being processed and applying that (or doing a funcall) to the
    specified function name. Now this is OK if it's an ordinary (lambda) function,
    because it's going to just treat them as values - but if a syntax form is called
    (like and), the syntax form may decide to evaluate its arguments.

    The same error occurs if you do:

    funcal('and t car(obj~>points))

    what's happening is it is seeing this as:

    and(t (57.0 1587.6))

    Wrapping the and in a lambda turns the syntax form into an ordinary function,
    and it all behaves as you'd expect then.

    Andrew.
     
    Andrew Beckett, Dec 1, 2005
    #5
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.