双向偏移对象,并改变偏移后的颜色。可以批量偏移,也可以点选偏移。- (defun c:tes ( / &k1 &kw1);点选或框选双向偏移对象;并改变颜色为红
- (vl-load-com)
- (princ "\n请选择要双向偏移的对象")
- (while (setq &kw1(ssget ":S" '((0 . "*LINE,CIRCLE,ARC,HELIX,ELLIPSE"))))
- (while (setq &k1 (ssname &kw1 0))
- (setq &kw1 (ssdel &k1 &kw1) &k1 (vlax-ename->vla-object &k1))
- (if (null (vl-catch-all-error-p (vl-catch-all-apply 'vla-offset (list &k1 2.0))))
- (vla-put-color (vlax-ename->vla-object (entlast)) 1)
- )
- (if (null (vl-catch-all-error-p (vl-catch-all-apply 'vla-offset (list &k1 -2.0))))
- (vla-put-color (vlax-ename->vla-object (entlast)) 1)
- )
- )
- )
- (princ)
- )
|