Dayananda Posted 8 hours ago Posted 8 hours ago I have following code to draw a line first and adjust the length of line using LENGTHEN command. Only after getting entity name I need to change its property etc. But the I cant stop the lengthen command and it repeating. Please explain me what is mistake in my command. (defun C:test1() (setq p1 (getpoint"\npick point1")) (setq p2 (getpoint"\npick point2")) (command "line""non"p1 "non"p2 ""); bottom bar (command "_lengthen" "DYnamic" "non"p2) (setq line1 (entlast)) (command "change" line1"""P""C""1"""); ) Quote
Steven P Posted 4 hours ago Posted 4 hours ago I don't think I have used lengthen in a LISP, not used the command for a while, but a quick look at your code "non"p2) - add a couple of spaces for readbility, but in that line you haven't specified the line to lengthen and you might need to end with "": (command "_lengthen" "DYnamic" "non" p2 (entlast) "") Quote
Nikon Posted 1 hour ago Posted 1 hour ago (edited) 7 hours ago, Dayananda said: But the I cant stop the lengthen command and it repeating. Maybe it is possible to change the order of commands, at first "_.change", then "_.lengthen" ? (defun C:LineChLenDY () (setq p1 (getpoint "Specify the first point: ")) (setq p2 (getpoint "Specify the second point: ")) (command "_.line" "_non" p1 "_non" p2 "") (setq line1 (entlast)) (command "_.change" line1 "" "_P" "_C" "1" "") (command "_.lengthen" "_DYnamic") (princ) ) Or without (_) (defun C:LineChLenDY () (setq p1 (getpoint "Specify the first point: ")) (setq p2 (getpoint "Specify the second point: ")) (command "line" "non" p1 "non" p2 "") (setq line1 (entlast)) (command "change" line1 "" "P" "C" "1" "") (command "lengthen" "DYnamic") (princ) ) Edited 59 minutes ago by Nikon Quote
Tsuky Posted 31 minutes ago Posted 31 minutes ago (edited) Use (list (entlast) p2) at place of p2: (list (entlast) p2) <=> at return of (entsel) (defun C:test1 ( / p1 p2 line1) (initget 1) (setq p1 (getpoint "\npick point1")) (initget 1) (setq p2 (getpoint p1 "\npick point2")) (command "_.line""_non" p1 "_non" p2 "") (setq line1 (entlast)) (command "_.lengthen" "_DYnamic" (list line1 p2) pause "") (command "_.change" line1 "" "_Properties" "_Color" "1" "") (prin1) ) Edited 25 minutes ago by Tsuky 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.