The following will offset to the current layer:
(defun c:mdoff ( / d i l o r s )
(setq l (getvar 'clayer))
(initget 6)
(if
(and
(setq d (getdist "\nSpecify offset distance: "))
(setq s
(ssget "_:L"
'(
(0 . "ARC,CIRCLE,ELLIPSE,*LINE")
(-4 . "<NOT")
(-4 . "<AND")
(0 . "POLYLINE") (-4 . "&") (70 . 80)
(-4 . "AND>")
(-4 . "NOT>")
)
)
)
)
(repeat (setq i (sslength s))
(setq i (1- i)
o (vlax-ename->vla-object (ssname s i))
)
(foreach x (list d (- d))
(if (not (vl-catch-all-error-p (setq r (vl-catch-all-apply 'vlax-invoke (list o 'offset x)))))
(foreach y r (vla-put-layer y l))
)
)
)
)
(princ)
)
(vl-load-com) (princ)