How to get the coordinates of a line/ edge of rectangle
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
How to get the coordinates of a line/ edge of rectangle

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence
Author Message
SS
Guest





Posted: Wed Nov 30, 2005 9:10 pm    Post subject: How to get the coordinates of a line/ edge of rectangle Reply with quote

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

Back to top
Andrew Beckett
Guest





Posted: Thu Dec 01, 2005 5:10 pm    Post subject: Re: How to get the coordinates of a line/ edge of rectangle Reply with quote

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

Quote:
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.
Back to top
Suresh Jeevanandam
Guest





Posted: Thu Dec 01, 2005 5:10 pm    Post subject: Re: How to get the coordinates of a line/ edge of rectangle Reply with quote

Andrew Beckett wrote:
Quote:
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

Back to top
Andrew Beckett
Guest





Posted: Thu Dec 01, 2005 9:10 pm    Post subject: Re: How to get the coordinates of a line/ edge of rectangle Reply with quote

On Thu, 01 Dec 2005 19:24:09 +0530, Suresh Jeevanandam
<sureshj@DELETETHISti.com> wrote:

Quote:
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.
Back to top
SS
Guest





Posted: Thu Dec 01, 2005 9:10 pm    Post subject: Re: How to get the coordinates of a line/ edge of rectangle Reply with quote

Andrew and Suresh,
Thanks
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB