;;; Pipe Maker: Offset Lines, Arcs, Splines, Plines Both Sides and erase originals
;;; Created by Ranjit.Singh
;;; Saved from: http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/offset-both-sides-erase-originals/m-p/6598353#U6598353

(defun c:pm ( / *error* of undo doc ss ) ;Ekv Both
(defun *error* ( msg )
(and undo (vla-EndUndomark doc))
(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **")))
(princ))
(if (and (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))
(setq of (getdist "\nSpecify Offset Distance: ")))
(progn
(setq undo (not (vla-StartUndomark (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))))))
(vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc))
(mapcar (function (lambda (o) (vl-catch-all-apply (function vla-offset) (list obj o))))
(list of (- of)))(vla-delete obj))
(setq undo (vla-EndUndoMark doc))))
(princ)
)
(c:pm)

Advertisements