Display full version of the post: Lisp Program Help

k8nadeau
25.02.2009, 20:53
I am trying to create a lisp program that will find the quarter point of a vertical line in order to draw a new line horizontally to represent welded wire fabric.

This is what I have. Everything works except the command line, which will not draw the line correctly.

(defun c:test()
(setq Pt1 (getpoint "\nSelect bottom point of line:"))
(setq X (car Pt1))
(setq Y1 (cadr Pt1))
(setq Pt2 (getpoint "\nSelect top point of line:"))
(setq Y2 (cadr Pt2))
(setq D (/(- Y2 Y1)4))
(setq DRL (+ D Y1))
(command "line" X DRL)
)

If anyone has any ideas, please don't hesitate. Thanks!



Vladimir Michl
25.02.2009, 21:02
Not tested but the last line should read something like:
 
(command "_LINE" (list X DRL) ...here add the second point of the line...)

k8nadeau
25.02.2009, 21:11
That is closer to what I want Thanks! But it is now drawing the line from the bottom of the vertical line. How do I get it so that it reads the coordinates correctly and draws the line from the quarter point?