woodman78 Posted June 9, 2015 Posted June 9, 2015 I came across this piece of code from LeeMac but when I run it and select a polyline nothing happens. Can anyone tell me why? http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polyline-offset-trim-and-erase/td-p/4503753 Quote
Commandobill Posted June 9, 2015 Posted June 9, 2015 You mean this one? (defun c:offout ( / e s ) (if (setq s (ssget "_+.:E:S" '((0 . "LWPOLYLINE") (90 . 4) (-4 . "&=") (70 . 1)))) (vl-catch-all-apply 'vla-offset (list (vlax-ename->vla-object (setq e (ssname s 0))) (if (LM:listclockwise-p (mapcar 'cdr (vl-remove-if-not '(lambda ( x ) (= 10 (car x))) (entget e)) ) ) -0.75 0.75 ) ) ) ) (princ) ) ;; List Clockwise-p - Lee Mac ;; Returns T if the point list is clockwise oriented (defun LM:ListClockwise-p ( lst ) (minusp (apply '+ (mapcar (function (lambda ( a b ) (- (* (car b) (cadr a)) (* (car a) (cadr b))) ) ) lst (cons (last lst) lst) ) ) ) ) (vl-load-com) (princ) It ran for me. Although, not very dynamic for Lee's standards. Quote
Lee Mac Posted June 9, 2015 Posted June 9, 2015 I came across this piece of code from LeeMac but when I run it and select a polyline nothing happens. Can anyone tell me why? http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polyline-offset-trim-and-erase/td-p/4503753 The program offsets a selected closed 4-vertex polyline to the outside by 0.75 units - therefore, in your case, either the polyline you have selected is smaller than this offset distance, or large enough that the offset is unnoticeable until you zoom in. Lee 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.