Eiler Posted October 3, 2022 Posted October 3, 2022 Hi, I havent done much of AutoCAD LISP writing, and certainly not for many years now, but I was trying to figure out how to make a simple function that would draw a cross with 2 diagonal lines, from lower left corner PT1 to upper right corner PT2. I thought it might be possible to draw a -pline from PT1(X1,Y1) - PT2(X2,Y2) -second pline from (X1,Y2) - (X2,Y1) This would save me time drawing different size crosses by letting me draw 2 diagonal line by clicking just two points could anyone help me with a code for this? Quote
Cad64 Posted October 3, 2022 Posted October 3, 2022 Instead of using a lisp routine, you can simply change the setting of PDMODE to 3 and then use the POINT command to place crosses. https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/AutoCAD-Core/files/GUID-82F9BB52-D026-4D6A-ABA6-BF29641F459B-htm.html 1 Quote
BIGAL Posted October 4, 2022 Posted October 4, 2022 (edited) cad64 I think wants like solution for like match a rectang with 2 diagonals. (defun c:xxx ( / pt1 pt2 pt3 pt4) (setq pt1 (getpoint "\nPick 1st point ") pt2 (getpoint pt1 "\npick 2nd point ")) (setq pt3 (list (car pt2) (cadr pt1)) pt4 (list (car pt1) (cadr pt2))) (command "line" pt1 pt2 "") (command "line" pt3 pt4 "") (princ) ) (c:xxx) Eiler your turn now. Edited October 4, 2022 by BIGAL 1 Quote
Eiler Posted October 4, 2022 Author Posted October 4, 2022 Thanks BigAl, that was exactly what I wanted! Cheers! Quote
BIGAL Posted October 4, 2022 Posted October 4, 2022 For requests a good idea is post an image or dwg. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.