Noodles Posted May 8, 2022 Posted May 8, 2022 Hi !, I wrote a lisp that allows you to lengthen or shorten the line on both sides by the given amount. Is it possible to modify this lisp to lengthen / shorten a given line to the given value, e.g. 3.5, 4 etc. relative to the center of this line? E.g Line length 2.35 -> extend it to length 2.50 on both sides with one command (defun c:df ( / ss en a) (if (and (setq ss (ssget "_+.:E:S" '((0 . "LINE")))) (setq en (ssname ss 0))) (command "_.LENGTHEN" "_DE" ;(setq a (getreal "\nO ile: ")) (setq *rev* ( (lambda ( input ) (if (eq "" input) *rev* input)) (getstring (strcat "\nEnter Revision Number <" (setq *rev* (cond ( *rev* ) ( "1" ))) "> : ")) ) ) (list en (trans (cdr (assoc 10 (entget en))) 0 1)) (list en (trans (cdr (assoc 11 (entget en))) 0 1)) "" )) (princ) ) Quote
tombu Posted May 9, 2022 Posted May 9, 2022 (edited) For that you'd need to use the "_.SCALE" command "Reference" option in the code using the calculated distance between the endpoints. Actually with that lisp you could lengthen from midpoint or either end so it would work for all you lengthen line work. Edited May 9, 2022 by tombu 1 Quote
BIGAL Posted May 9, 2022 Posted May 9, 2022 (edited) "I wrote a lisp" your new lisp entsel line get the start and end points get angle of start - end mid point (setq mp (mapcar '* (mapcar '+ start end) '(0.5 0.5))) use polar new end with new dist use polar new start use entmod on dxf 10 & 11 Edited May 9, 2022 by BIGAL 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.