[现学现用]会动的cad----会走的闹钟!
学习高手们的思路,我学着用cad作了个会动的闹钟,其实还可以再扩展为实体,或者电子显示表,因为时间的原因只能做到这个地步.....希望大家热烈参与讨论并完善.....在此现谢谢大家!! 不错不错,恭喜恭喜 把源代码贴给大家,不过这个思路是从高手那里学来的.....为了讨论,也只好借花现佛....附件是lsp运行的cad图形。打开图形加载程序输入"bb"侧从零开始转起.....希望高手改进.....不要每次都总是从零开始转起....;========================<BR>;从零开始的闹钟<BR>;ljc 2004.6.15<BR>;========================<BR>(defun c:BB ()<BR> (command "ucs" "w")<BR> (setq os (getvar "osmode"))<BR> (setvar "osmode" 0) <BR> (setq ho (getvar "cmdecho"))<BR> (setvar "CMDECHO" 0) <BR> (command "erase" "all" "")<BR> (COMMAND "-INSERT" "bp" (LIST 0 0 0) "" "" "")<BR> (COMMAND "-INSERT" "H" (LIST 0 0 10) "" "" "")<BR> (setq H (entget (entlast)))<BR> (COMMAND "-INSERT" "M" (LIST 0 0 20) "" "" "")<BR> (setq M (entget (entlast))) <BR> (COMMAND "-INSERT" "S" (LIST 0 0 30) "" "" "")<BR> (setq S (entget (entlast)))<BR> (SETQ N 1 nn 1 nnn 1)<BR> (while t<BR> (SETQ SJ (* (/ n -30.0) pi ) )<BR> (setq S (subst (cons 50 SJ) (assoc 50 S) S))<BR> (SETQ mJ (* (/ nnn -1800.0) pi ) )<BR> (setq m (subst (cons 50 mJ) (assoc 50 m) m))<BR> (entmod S)(entmod m)<BR> (COMMAND "DELAY" "1000")<BR> (if (= n 60) <BR> (progn<BR> (setq n 1) <BR> (SETQ hJ (* (/ nn -360.0) pi ) )<BR> (setq h (subst (cons 50 hJ) (assoc 50 h) h)) <BR> (COMMAND "DELAY" "0")<BR> (entmod h) <BR> (setq nn (+ nn 1)) <BR> )<BR> (SETQ N (+ N 1))<BR> );if<BR> (setq nnn (+ nnn 1))<BR> (if (= nnn 3600) (setq nnn 1))<BR> );while<BR> <BR> (setvar "osmode" os)<BR> (setvar "cmdecho" ho) <BR>)
厉害啊!好佩服啊。。。。。。怎么可以这样子呢? 不错,不错
我运行了那个程序,会这样啊???
你把他的表.dwgCOPY到你的CAD安装目录下的support目录下就OK了 <A name=27377><FONT color=#000066><B>ljcgq</B></FONT></A>你越来越强了!
真佩服!
我这样做了,还是没有用啊
CADghost发表于2004-6-16 10:37:00static/image/common/back.gif你把他的表.dwgCOPY到你的CAD安装目录下的support目录下就OK了
<BR> <A name=27549><FONT color=#000066><B>ldb1420</B></FONT></A>:你把表.dwg文件打开,然后加载程序,运行。