本帖最后由 x_s_s_1 于 2020-3-18 19:34 编辑
没那么麻烦
- (defun c:test1 (/ 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)
- pt14 (trans pt14 0 v)
- pt13t (trans pt13 0 v)
- )
- (mapcar
- '+
- pt10
- (mapcar '(lambda (x y) (* 0.5 (- x y)))
- pt13
- (trans (list (car pt14) (cadr pt14) (caddr pt13t)) 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)
- )
- )
- )
- )
|