Jump to content

Help with a Leemac routine:


woodman78

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...