- (defun c:test()
- (setq ss (ssget))
- (setq po (getpoint "\nchosebase:"))
- (setq a (getreal "\ndistance:"))
- (setq n (getint "\nlefttimes:"))
- (setq n2 (getint "\nrighttimes:"))
- (setq p1 (polar po pi a));left
- (setq p2 (polar po 0 a));right
- (command "copy" ss "" po p1)
- (command "copy" ss "" po p2)
- (repeat (- n 1) ;left
- (setq mult 0)
- (setq p3 (polar p1 pi (* a (setq mult (1+ mult)))))
- (setq p1 p3)
- (command "copy" ss "" po p1)
- );repeat
- (repeat (- n2 1) ;right
- (setq mult2 0)
- (setq p4 (polar p2 0 (* a (setq mult2 (1+ mult2)))))
- (setq p2 p4)
- (command "copy" ss "" po p2)
- );repeat
- );test
新代码研究
但是为什么mult可以加1?在重复功能中,你能做到吗? |