;;双向偏移 SNSJ 2004.3.8
(defun c:OffsetBoth (/ getds obj lynm ptlay)
  (defun ptlay (x y)
    (foreach obj (vlax-safearray->list (vlax-variant-value x))
      (vla-put-layer obj y)
    )
  )
  (setq	getds
	 (getdist
	   (strcat "\n输入偏移距离<" (rtos (getvar "offsetdist")) ">:")
	 )
  )
  (or getds (setq getds (getvar "offsetdist")))
  (setvar "offsetdist" getds)
  (setq lynm (getvar "clayer"))
  (while (ssget ":S" '((0 . "Arc,Circle,Ellipse,*Line")))
    (vlax-for obj (vla-get-activeselectionset *doc*)
      (ptlay (vla-offset obj getds) lynm)
      (ptlay (vla-offset obj (* getds -1)) lynm)
      (vlax-release-object obj)
    )
  )
  (princ)
)