277283904
发表于 2024-1-3 08:31:13
感谢各位!!!
277283904
发表于 2024-1-3 08:37:25
xyp1964 发表于 2024-1-2 18:48
感谢版主,这是固定距离了,要修改距离的话要到代码里修改吗?{:1_1:}
xyp1964
发表于 2024-1-3 12:58:00
277283904 发表于 2024-1-3 08:37
感谢版主,这是固定距离了,要修改距离的话要到代码里修改吗?
(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)
)
Qwer1243
发表于 2024-9-25 08:26:19
xyp1964 发表于 2024-1-3 12:58
感谢分享......................