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

S

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
 
On 30 Nov 2005 09:50:16 -0800, "SS" <ssriramiyer@gmail.com> wrote:

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
geGetSelSetFigPoint() is the function you want. This will tell you which points
on an object are selected.

Andrew.
 
Andrew Beckett wrote:
On 30 Nov 2005 09:50:16 -0800, "SS" <ssriramiyer@gmail.com> wrote:


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


geGetSelSetFigPoint() is the function you want. This will tell you which points
on an object are selected.

Andrew.
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
 
On Thu, 01 Dec 2005 19:24:09 +0530, Suresh Jeevanandam
<sureshj@DELETETHISti.com> wrote:

Andrew Beckett wrote:
On 30 Nov 2005 09:50:16 -0800, "SS" <ssriramiyer@gmail.com> wrote:


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


geGetSelSetFigPoint() is the function you want. This will tell you which points
on an object are selected.

Andrew.

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
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.
 

Welcome to EDABoard.com

Sponsor

Back
Top