Print Page | Close Window

Lisp Program Help

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=1730
Printed Date: 01.Jun.2026 at 03:46


Topic: Lisp Program Help
Posted By: k8nadeau
Subject: Lisp Program Help
Date Posted: 25.Feb.2009 at 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!




-------------
K8



Replies:
Posted By: Vladimir Michl
Date Posted: 25.Feb.2009 at 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...)


-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: k8nadeau
Date Posted: 25.Feb.2009 at 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?

-------------
K8



Print Page | Close Window