(defun c:dqwb ()
(setq a (ssget (list (cons 0 "text"))))
(setq n (sslength a))
(setq all nil)
(setq m 0)
(while (< m n)
(setq all (append all (list (entget (ssname a m)))))
(setq m (1+ m))
)
(setq l 0);按y坐标降序排列
(setq m 1)
(while (< l n)
(setq b (nth l all))
(while (< m n)
(setq c (nth m all))
(if (> (nth 2 (assoc ’10 c)) (nth 2 (assoc ’10 b)))
(progn
(setq all (subst ’aa (nth l all) all ) )
(setq all (subst ’bb (nth m all) all ) )
(setq all (subst c ’aa all ) )
(setq all (subst b ’bb all ) )
(setq b c)
)
)
(setq m (1+ m))
)
(setq l (1+ l))
(setq m (1+ l))
)
(setq val (getdist "\n行距:"))
(setq p (getpoint "\n首行的插入点:"))
(setq x0 (car p))
(setq y0 (cadr p))
(setq m 0)
(while (< m n)
(setq b (nth m all))
(setq y (- y0 (* m val)))
(setq z (nth 3 (assoc ’10 b)))
(setq xyz_new (list ’10 x0 y z))
(setq b (subst (cons ’72 0) (assoc ’72 b) b))
(setq b (subst (cons ’73 0) (assoc ’73 b) b))
(setq b (subst xyz_new (assoc ’10 b) b ) )
(entmod b)
(setq m (1+ m))
)
)
(princ "\n===对齐单行文本,自定义行距程序成功加载!命令行以dqwb启动!")
全部回复(14 )
只看楼主 我来说两句回复 举报
回复 举报