以下为代码 - (defun c:dsin( / x n z s dx cm bl x0 y0)
- (setq x 0
- p (getpoint "\n基点:")x0(car p)y0(cadr p)
- n (getint "\n精度(全线上直线片段数):")
- z (getreal "\n周期数:")
- s (getreal "\n波高系数:")
- dx (/ (* z 2 pi) n)
- )
- (setq cm(getvar "cmdecho")bl(getvar "blipmode")
- os(getvar "osmode")
- )
- (setvar "cmdecho" 0)(setvar "blipmode" 0)(setvar "osmode" 0)
- (command "pline" p)
- (repeat n
- (setq x (+ x dx))
- (command (list (+ x0 x) (+ y0 (* s (sin x)))))
- )
- (command "")
- (setvar "cmdecho" cm)(setvar "blipmode" bl)(setvar "osmode" os)(princ)
- )
加载时控制台提示:参数类型错误: numberp: nil
敢为高手问题出在哪?
|