明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1788|回复: 1

[LISP]一个点取单文本写序号的程序

[复制链接]
发表于 2004-3-18 22:09:00 | 显示全部楼层 |阅读模式
;将其加载导 Acad.lsp中 xxh 命令启动 (defun c:xxh()
(setq old_style (getvar "textstyle"))
(setq new_style "standard")
(setq xh_st (getint "\n从几开始<1>:"))
(if (= xh_st nil) (setq xh_st 1)())
(setq xx "y")
(while (= xx "y")
(setq txt_sel (entget (car (entsel"点取文本:"))))
(while (= txt_sel nil) (setq txt_sel (entget (car (entsel"点取文本:")))))
(setq txt_wz (assoc 10 txt_sel))
(setq txt_h (assoc 40 txt_sel))
(setq txt_kd (assoc 41 txt_sel))
(setq wz (cdr txt_wz))
(setq wz_x (car wz ) wz_y (cadr wz) wz_z (cddr wz))
(setq h (cdr txt_h))
(setq kd (cdr txt_kd))
(setq xh_dx (* h 1.5))
(setq xh_wz (mapcar '- wz (list xh_dx 0 0)))
(command "text" "s" "standard" xh_wz (* h 0.8) 0 (strcat (rtos (fix xh_st) 2 0) ".") )
(setq xh_st (1+ xh_st))
)
(setvar "textstyle" old_style)
)
发表于 2004-3-19 22:47:00 | 显示全部楼层
不怎么样.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-10-1 19:30 , Processed in 0.139448 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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