Dayananda Posted 11 hours ago Posted 11 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 7 hours ago Posted 7 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 4 hours ago Posted 4 hours ago (edited) 9 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 ( / p1 p2 line1) (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 1 hour ago by Nikon Quote
Tsuky Posted 3 hours ago Posted 3 hours 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 3 hours ago by Tsuky 1 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.