;;;
;;; jbTools R4 Copyright © 2001
;;;
(defun c:jbOffsetLayer (/ *Error* off_lay lay b off_dist ent_set ent p1
old-dist)
(defun *Error* (Msg)
(cond
((or (not Msg) ;<- note this (or) clause
(member Msg
'("console break"
"Function cancelled"
"quit / exit abort"
)
) ;_ closes member
) ;_ closes or
) ;_ closes condition, no message to display
((princ (strcat "\nError: " Msg))) ; else display message
) ;_ closes cond
(if ent
(redraw ent 4)
)
(if (and old_filletrad (> old-dist -1))
(setvar "offsetdist" old-dist)
)
(princ)
)
(setq off_lay (getvar "clayer"))
(setq lay (entsel
"\nPick an object on the layer for Offset: "
)
)
(if lay
(progn
(setq off_lay (cdr (assoc 8 (entget (car lay)))))
)
)
(if (= (setq old-dist (getvar "offsetdist")) -1)
(setq b "Through")
(setq b (rtos (getvar "offsetdist") 4))
)
(setq off_dist (getdist (strcat "\nOffset distance or Through <" b "> ")))
(if (= off_dist nil)
(setq dist b)
(setq dist off_dist)
)
(setq ent_set (entsel "\nSelect object to offset: "))
(while ent_set
(setq ent (car ent_set))
(redraw ent 3)
(setq p1 (getpoint "\nSide to offset? "))
(redraw ent 4)
(command "_.offset" dist ent_set p1 "")
(vlax-put-property (vlax-ename->vla-object (entlast)) 'layer off_lay)
(setq ent_set (entsel "\nSelect object to offset or : "))
)
(princ)
(princ)
)