wide
发表于 2024-5-3 14:18:14
x_s_s_1 发表于 2020-3-18 19:12
没那么麻烦
的确看不懂。
(mapcar
'+
pt10
(mapcar '(lambda (x y) (* 0.5 (- x y)))
pt13
(trans (list (car pt14) (cadr pt14) (caddr pt13t)) v 0)
)
)
wide
发表于 2024-5-3 16:27:29
x_s_s_1 发表于 2020-3-18 19:12
没那么麻烦
为什么这样不行?{:1_1:}
(defun c:test2 (/ get_dim_mid ss n)
(defun get_dim_mid (en / ent pt10 pt13 pt14 v pt13t)
(setq ent(entget en)
pt10(cdr (assoc 10 ent))
pt13(cdr (assoc 13 ent))
pt14(cdr (assoc 14 ent))
v(mapcar '- pt10 pt14)
pt10v(trans pt10 0 v)
pt13v(trans pt13 0 v)
)
(trans
(mapcar '(lambda (x y) (* 0.5 (+ x y)))
pt10v
(list (car pt13v) (cadr pt13v) (caddr pt10v))
)
v 0
)
)
(setq ss (ssget))
(repeat (setq n (sslength ss))
(entmake
(list (cons 0 "circle")
(cons 10 (get_dim_mid (ssname ss (setq n (1- n)))))
(cons 40 100)
)
)
)
)