找回密码
 [加入论坛]
查看: 1328|回复: 0

[转帖]一个多行文本平均行距的小程序

[复制链接]
2443725 发表于 2004-8-31 15:04 | 显示全部楼层 |阅读模式
<>;平均分布各行文字
;作者:吴殷飞
;作者单位:安庆市水利水电规划设计院
;禁止以商业为目的在网上传播
;如有疑问,请联系aqsssjy@mail.hf.ah.cn</P>
<P>(defun c:ath()</P>
<P>(setq a (ssget (list (cons 0 "text"))))
(setq n (sslength a))
(setq all nil)
(setq m 0)
(while (&lt; m n)
  (setq all (append all (list (entget (ssname a m)))))
  (setq m (1+ m))
)</P>
<P>
(setq l 0)
(setq m 1)
(while (&lt; l n)
  (setq b (nth l all))
  (while (&lt; m n)
    (setq c (nth m all))
    (if (&gt; (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))
)</P>
<P>(setq a (nth 0 all))
(setq b (nth (1- n) all))
(setq detay (/ (- (nth 2 (assoc '10 a)) (nth 2 (assoc '10 b))) (1- n)))
(setq y0 (nth 2 (assoc '10 a)))</P>
<P>(setq m 0)
(while (&lt; m n)
  (setq b (nth m all))
  (setq x (nth 1 (assoc '10 b)))
  (setq y (- y0 (* m detay)))
  (setq z (nth 3 (assoc '10 b)))
  (setq xyz_new (list '10 x y z))
  (setq b (subst xyz_new (assoc '10 b) b))
  (entmod b)
;  (entupd b)
  (setq m (1+ m))
)</P>
<P>) </P>
您需要登录后才可以回帖 登录 | [加入论坛]

本版积分规则

手机版|化工技术网- 赠人玫瑰 手有余香 ( 苏ICP备14035884号 )

GMT+8, 2026-12-1 18:18

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表