Fix lisp

Fix lisp

Automohan
Advocate Advocate
908 Views
2 Replies
Message 1 of 3

Fix lisp

Automohan
Advocate
Advocate

Lisp error...

(defun c:zw (/ pt1 pt2)
(if
  (and
   (setq pt1 (getpoint "\nSelect First Window Point: "))
   (setq pt1 (osnap pt1 "_end"))
   (setq pt2 (getpoint "\nSelect Second Window Point: "))
   (setq pt2 (osnap pt2 "_end"))
  )
   (command "._zoom" "_w" "_non" pt1 "_non" pt2) ; end zoom
   (command "_.pspace")
   (command "_.MVIEW" "L" "ON" "P" "")
)
(princ)
) ; end of program
"Save Energy"
Did you find this reply helpful? If so please use the Accept as Solution
0 Likes
Accepted solutions (1)
909 Views
2 Replies
Replies (2)
Message 2 of 3

cadffm
Consultant
Consultant
Accepted solution

IF expect just one exoression for THEN case.

Use PROGN or use just one (command ..) function.

 

[F1] if (AutoLISP)

Sebastian

0 Likes
Message 3 of 3

Automohan
Advocate
Advocate
(defun c:zw (/ pt1 pt2)
(if
  (and
   (setq pt1 (getpoint "\nSelect First Window Point: "))
   (setq pt1 (osnap pt1 "_end"))
   (setq pt2 (getpoint "\nSelect Second Window Point: "))
   (setq pt2 (osnap pt2 "_end"))
  )
   (command "._zoom" "_w" "_non" pt1 "_non" pt2 "_.pspace" "_.mview" "l" "on" "l" "")
)
(princ)
); end of program
"Save Energy"
Did you find this reply helpful? If so please use the Accept as Solution
0 Likes