- (defun c:11 (/ getds obj)
- (vl-load-com)
- (setq lay (getvar "CLAYER"))
- (setvar 'cmdecho 0)
- (initget 2)
- (setq getds (getdist "\n输入偏移距离<可直接量取>:"))
- (if (ssget ":s" '((0 . "Arc,Circle,Ellipse,*Line")))
- (progn
- (vlax-for obj (vla-get-activeselectionset
- (vla-get-activedocument (vlax-get-acad-object))
- )
- (foreach x (list getds (* getds -1))
- (vla-offset obj x )
- (vla-put-layer (vlax-ename->vla-object (entlast)) lay)
- )
-
- )
- )
- (vlax-release-object obj)
- )
- (if (not (getpoint "\n按鼠标左键不删除源对象 <空格删除>"))
- (command "_.ERASE" (ssget "p") "")
- )
- (princ)
- )
|