- (defun c:sx (/ getds ss i e obj)
- (vl-load-com)
- (setvar 'cmdecho 0)
- (initget 2)
- (setq getds (getdist "\n输入偏移距离<可直接量取>:"))
- (if (not getds)
- (exit)
- )
- (setq ss (ssget '((0 . "Arc,Circle,Ellipse,*Line"))))
- (if (not ss)
- (exit)
- )
- (setq i 0)
- (repeat (sslength ss)
- (setq e (ssname ss i)
- obj (vlax-ename->vla-object E)
- i (1+ i)
- )
- (vl-catch-all-apply 'vla-offset (list obj getds))
- (vl-catch-all-apply 'vla-offset (list obj (* getds -1)))
- )
- (if (not (getpoint "\n按鼠标左键不删除源对象 <空格删除>"))
- (command "_.ERASE" (ssget "p") "")
- )
- (princ)
- )
|