0 Replies Last post: May 24, 2005 3:25 PM by Guy Jr Pilon  
Guy Jr Pilon Newbie 1 posts since
May 24, 2005
Currently Being Moderated

May 24, 2005 3:25 PM

Order of operation in lisp code

Hi,

 

I have a problem with a simple code. Here's the code:

 

1- (defun c:tr (/ cr coord)

2-   (setvar "cmdecho" 0) 

3-   (setq cr (getpoint "\Pick the center of   rotation:  "))

4-   (prompt "\nOutline the material ")(terpri)

5-   (command "rectang")

6-   (setq coord (entget(entlast))) 

7-  )

 

I want the user to create a rectangle (line #5) and then get the rectangle's infos with an entlast (line #6). THe problem is that the program executes line #6 before line #5.

 

I'd like to know why and how to remedy to it.

 

Thanks,

 

Guy 

More Like This

  • Retrieving data ...