I need an offset lisp routine to offset a selected line a set distance on each side of the selected line and change the layer of the offset lines to the current layer, and then keep prompting me to select the next line for offsetting until I'm finished.
Anyone have anything like this?
See this, if it doesn't do exactly what you want, it's a good head start:
http://forums.augi.com/showthread.php?9932-Offset-line-both-sides-at-the-same-time
Give this a try...
to run command after lisp is loaded type "droffset"
;***********************************************************************************
(DEFUN c:droffset (/ layer echo temp entity);start of offset
(if (= initerr nil)
(progn
(load "error")
(initerr)
)
)
(setq layer (getvar "clayer")
oldlay (getvar "clayer")
echo (getvar "cmdecho"))
(setvar "cmdecho" 0)
(while
(progn
(setq temp (getstring (strcat "\nDestination layer?<"layer">:")))
(cond
((eq temp "") nil)
((tblsearch "layer" temp) (setq layer temp) nil)
(t (princ "\nLayer not found."))
)))
(initget (+ 2 4) "through")
(setq temp (getdist (strcat "\nOffset distance or through <"
(if dist (rtos dist) "through") ">: ")))
(cond
((eq temp "through") (setq dist nil))
(temp (setq dist temp))
)
(setq temp (if dist "\nSide to offset?"
"\nThrough point: "))
(while
(and
(setq entity (entsel
"\nSelect object to offset: "))
(setq pt (getpoint temp))
)
(command ".offset" (if dist dist "t")
entity pt "")
(setq entity (entlast)
entity (entget entity)
entity (subst (cons 8 layer)
(assoc 8 entity) entity))
(entmod entity)
)
(setvar "cmdecho" echo)
(COMMAND "LAYER" "S" oldlay "")
(reset nil)
;(princ)
); end of offset
;***********************************************************************************