- (defun c:tt ()
- (defun xyp-StrSpr (str sub / lst n)
- (if (/= sub "")
- (progn
- (while (setq n (vl-string-search sub str))
- (setq lst (cons (substr str 1 n) lst)
- str (substr str (+ n (strlen sub) 1))
- )
- )
- (vl-remove "" (reverse (cons str lst)))
- )
- )
- )
- (princ "\n输入多重距离以分号分开(正负值偏移方向不同)")
- (or dd (setq dd "-15;-30;20;60;100"))
- (setq dd (Ustr -1 "距离表" dd nil))
- (setq lst (xyp-StrSpr dd ";")
- lst (vl-remove-if-not 'distof lst)
- lst (mapcar 'distof lst)
- )
- (while (setq s1 (car (entsel "\n选择需要偏移的对象: ")))
- (setq ob (vlax-ename->vla-object s1))
- (mapcar '(lambda (x) (vla-offset ob x)) lst)
- )
- (princ)
- )
|