最初由 lidejun_55 发布
[B](command "pline")
(while (setq pt1 (getpoint "\n下一点 : "))
……
……
(command pt1)
)
(command "")
通过调试:在执行(command "")时出现下面的错误:
需要点或选项关键字。
; 错误: ?.. [/B]
把程序贴全!
参考
 - [FONT=courier new](load "xyp_lib.vlx") ;版本 V.20060210 (2055)
- ;|下载和加载通用函数(可在签名栏直接下载后放到搜索路径下)
- 利用以下任何一种方式(首选第一种)即可加载和运行通用函数内的所有子程序:
- ★1·在acad.lsp中增加(load"xyp_lib.vlx")
- ■2·在每个程序内增加(load"xyp_lib.vlx")
- ■3·在command下,输入(load"xyp_lib.vlx")
- ■4·在菜单.mnl中增加(load"xyp_lib.vlx")
- ■5·将xyp_lib.vlx文件直接拽到cad屏幕
- [COLOR=red] ★通用函数下载地址:[/COLOR]
- [url]http://www.xdcad.net/forum/attachment.php?s=&postid=1606661[/url]
- |;
- ;;;一级方程动画:随机数与自定义曲线的结合
- (defun c:test087 (/ rad)
- (while t
- (drawline)
- (setq ss (entlast))
- (command "zoom" "e")
- (setvar "pdmode" 36)
- (setvar "PDSIZE" -5)
- (setq a 10 ;
- b 9 ;33
- no1 1
- rad 0
- no2 3
- l (strlen (rtos (getvar "cputicks") 2 0))
- i 0
- )
- (while (<= rad pi)
- (setq nb1 (rtos (getvar "cputicks") 2 0)
- l1 (strlen nb1)
- nb1 (substr nb1 (- l1 (- (fix no2) 1)))
- nb2 (rtos (getvar "cputicks") 2 0)
- l2 (strlen nb2)
- nb2 (substr nb2 (- l2 (- (fix no2) 1)))
- col (rem (atoi (substr nb2 1)) 256)
- )
- (if (= col 0)
- (setq col 1)
- )
- (MKLA (rtos col 2 0) col)
- (setq r (* a rad (sin (* b rad)) (sin (* b rad)))
- pt (polar (list 0 0) rad r)
- )
- (command "point" pt)
- (command "delay" "20")
- (command "erase" "l" "")
- (setq rad (+ rad (* Pi 0.001)))
- )
- (command "delay" "2000")
- (command "erase" "l" "")
- )
- (pxyp "YJFC (一级方程)")
- )
- (defun drawline ()
- (setq a 10 ;10
- b 9 ;33
- no1 1
- rad 0
- )
- (command "pline")
- (while (<= rad pi)
- (setq r (* a rad (sin (* b rad)) (sin (* b rad)))
- pt (polar (list 0 0) rad r)
- )
- (command pt)
- (setq rad (+ rad (* Pi 0.001)))
- )
- (command "")
- )
- (defun c:yjfc () (c:test086) (princ))[/FONT]
|