明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3294|回复: 4

修改别人的插入当前时间段!

[复制链接]
发表于 2004-9-25 21:28:00 | 显示全部楼层 |阅读模式
(defun c:rq (/ tmp cy cm cd txt txt1 pt1)
(setq tmp (rtos (getvar "cdate") 2 16))
(setq cy (rtos (atof (substr tmp 1 4)) 2 0)
cm (rtos (atof (substr tmp 5 2)) 2 0)
cd (rtos (atof (substr tmp 7 2)) 2 0)
)
(cond ((= cm "1")(setq cm "Jan"))
((= cm "2")(setq cm "Feb"))
((= cm "3")(setq cm "Mar"))
((= cm "4")(setq cm "Apr"))
((= cm "5")(setq cm "May"))
((= cm "6")(setq cm "Jun"))
((= cm "7")(setq cm "Jul"))
((= cm "8")(setq cm "Aug"))
((= cm "9")(setq cm "Sep"))
((= cm "10")(setq cm "Oct"))
((= cm "11")(setq cm "Nov"))
((= cm "12")(setq cm "Dec"))
);cond
(setq txt (strcat "现在是:" cd "," cm "," cy " ")
txt1 (strcat cd "," cm "," cy " ")
)
(COMMAND "style" "宋体" "宋体" "300" "1" "0" "" "")
(alert txt)
(setq pt1(getpoint"\n\t放置点 : "))
(command "text" "j" "mc" pt1 "0" txt1)
(princ)
)


哪位大侠帮忙修改一下,使之变为点选文字使之内容变为当前时间!
恨自己不懂LISP的编写,只会照猫画虎.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2004-9-25 23:18:00 | 显示全部楼层

回复

(defun c:rq (/ tmp cy cm cd txt txt1 pt1)
(setq tmp (rtos (getvar "cdate") 2 16))
(setq cy (rtos (atof (substr tmp 1 4)) 2 0)
cm (rtos (atof (substr tmp 5 2)) 2 0)
cd (rtos (atof (substr tmp 7 2)) 2 0)
)
(cond ((= cm "1")(setq cm "Jan"))
((= cm "2")(setq cm "Feb"))
((= cm "3")(setq cm "Mar"))
((= cm "4")(setq cm "Apr"))
((= cm "5")(setq cm "May"))
((= cm "6")(setq cm "Jun"))
((= cm "7")(setq cm "Jul"))
((= cm "8")(setq cm "Aug"))
((= cm "9")(setq cm "Sep"))
((= cm "10")(setq cm "Oct"))
((= cm "11")(setq cm "Nov"))
((= cm "12")(setq cm "Dec"))
);cond
(setq txt (strcat "现在是:" cd "," cm "," cy " ")
txt1 (strcat cd "," cm "," cy " ")
)
(COMMAND "style" "宋体" "宋体" "300" "1" "0" "" "")
(alert txt)
;;;(setq pt1(getpoint"\n\t放置点 : "))
;;;(command "text" "j" "mc" pt1 "0" txt1)
(setq ename (car (entsel)))
(if ename
(progn
(setq elist (entget ename))
(if (= (cdr (assoc 0 elist)) "TEXT")
(progn
(setq elist (subst (cons 1 txt1) (assoc 1 elist) elist))
(entmod elist)
)
)
)
)
(princ)
)
 楼主| 发表于 2004-9-26 13:44:00 | 显示全部楼层
谢谢!
发表于 2013-6-27 09:07:26 | 显示全部楼层
谢谢楼主的分享!很有意思的代码,收藏备用。
发表于 2013-12-28 01:13:28 | 显示全部楼层
贴张图看一下!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-25 12:33 , Processed in 0.160058 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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