注册 登录
明经CAD社区 返回首页

437271963的个人空间 http://www.mjtd.com/?7314414 [收藏] [复制] [分享] [RSS]

留言板

facelist doodle涂鸦板

您需要登录后才可以留言 登录 | 注册


jactry 2016-11-25 09:20
(setq txt3 (itoa (+ (atoi txt1) 999)))
比如txt1的值是096097,这段代码的结果是:096097+999=97096   我想要的结果是097096
jactry 2016-11-25 00:10
437271963: 说明整体思路要求,最后的结果。
A161124 放前面?
jactry 2016-11-25 00:10
437271963: 说明整体思路要求,最后的结果。
A161124 放前面?
jactry 2016-11-24 23:44
这么保证整数位是3位,如果是2位前面补个0,3位就不变
jactry 2016-11-24 23:42
(defun c:xx()
        (setvar "cmdecho" 0)            ;命令执行过程不响应
        (setvar "osmode" 32)             ;交点捕捉模式
        ;根据文字中心计算各插入点的坐标
        (setq ss (ssget "X" (list (cons 1 "秘密"))))
        (command "erase" ss "")
        (setq pt (getpoint "\n西南角坐标点:"))
        (setq ptx (car pt)) (setq pty (cadr pt))
        (setq pt1x (+ ptx 125.00)) (setq pt1y (+ pty 217.50)) (setq pt1 (list pt1x pt1y))
        (setq pt2x (+ ptx 227.00)) (setq pt2y (+ pty 208.50)) (setq pt2 (list pt2x pt2y))
        (setq pt3x (+ ptx 231.25)) (setq pt3y (+ pty 217.50)) (setq pt3 (list pt3x pt3y))
        (setq pt4x (+ ptx 238.75)) (setq pt4y (+ pty 217.50)) (setq pt4 (list pt4x pt4y))
        (setq pt5x (+ ptx 246.25)) (setq pt5y (+ pty 217.50)) (setq pt5 (list pt5x pt5y))
        (setq pt6x (+ ptx 231.25)) (setq pt6y (+ pty 213.50)) (setq pt6 (list pt6x pt6y))
        (setq pt7x (+ ptx 246.25)) (setq pt7y (+ pty 213.50)) (setq pt7 (list pt7x pt7y))
        (setq pt8x (+ ptx 231.25)) (setq pt8y (+ pty 209.50)) (setq pt8 (list pt8x pt8y))
        (setq pt9x (+ ptx 238.75)) (setq pt9y (+ pty 209.50)) (setq pt9 (list pt9x pt9y))
        (setq pt10x (+ ptx 246.25)) (setq pt10y (+ pty 209.50)) (setq pt10 (list pt10x pt10y))
        (setq pt11x (+ ptx 0)) (setq pt11y (- pty 17.50)) (setq pt11 (list pt11x pt11y))

        (setq txt1 (strcat (rtos(/ (- pty 950000) 200) 5 2) (rtos(/ (- ptx 350000) 250) 5 2)))          ;比如:这里结果应该为096098,计算出后只有9698
        (setq txt2 "秘密")
        (setq txt3 (itoa (+ (atoi txt1) 999)))
        (setq txt4 (itoa (+ (atoi txt1) 1000)))
        (setq txt5 (itoa (+ (atoi txt1) 1001)))
        (setq txt6 (itoa (- (atoi txt1) 1)))
        (setq txt7 (itoa (+ (atoi txt1) 1)))
        (setq txt8 (itoa (- (atoi txt1) 1001)))
        (setq txt9 (itoa (- (atoi txt1) 1000)))
        (setq txt10 (itoa (- (atoi txt1) 999)))
        (setvar "osmode" 0)             ;关闭捕捉模式

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

GMT+8, 2024-4-26 08:10 , Processed in 0.100008 second(s), 9 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部