明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2032|回复: 4

数字加常数及改精度

[复制链接]
发表于 2013-10-27 19:04 | 显示全部楼层 |阅读模式
(defun c:LT007 ( / ss i nall ent entl i nmb nall nalls k dec)
(setq ss (ssget '((0 . "TEXT")))
i 0
nadd (getdist "\n加常数(减常数为负;直接回车改精度):")
dec (getint "\n精度<2>:")
)
(if (not nadd)(setq nadd 0))
(if (not dec)(setq dec 2))
(repeat (sslength ss)
    (setq ent (ssname ss i)
entl (entget ent)
i (1+ i)
nmb (cdr(assoc 1 entl))
    )
    (if (or (= 'REAL (type (read nmb)))(= 'INT (type (read nmb))))
(progn
(setq nmb (atof nmb)
       endn (+ nmb nadd)
       nmb (rtos endn 2 dec)
       entl (subst (cons 1 nmb)(assoc 1 entl) entl)
)
        (entmod entl)
)
    );;end if
) ;;end repeat
(princ)
)
发表于 2015-9-7 22:40 来自手机 | 显示全部楼层
试试改精度功能,谢谢!
发表于 2017-11-28 17:02 | 显示全部楼层
谢谢,正需要
发表于 2017-12-2 11:42 | 显示全部楼层
这个有什么用,有演示吗
发表于 2018-5-14 17:32 | 显示全部楼层
谢谢,正需要
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-20 15:48 , Processed in 0.385782 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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