演示代码
- (defun c:demo ()
- (setvar 'osmode 512);-- nearest osnap
- (setq wall1 (getpoint "\nPick start point"));<-- point at wall
- (setvar 'osmode 128);-- perpendicular osnap
- (setq wall2 (getpoint wall1 "\nPick next point"));<-- point at opposite wall
- (setq dist (distance wall1 wall2))
- (setq qnty (fix (/ dist 6)));<-- board width
- (setq gap (/ (- dist (* qnty 6)) (1- qnty)));<-- gap width
- (setvar 'osmode 0)
- (command "_line" wall1 (polar wall1 0 6) "")
- (command "_-array" (entlast) "" "_Rectangular" "1" qnty (+ gap 6))
- (princ)
- )
现在,如果我能学习李·麦克的技巧,让这些代码都用颜色格式化,等等。。。哎呀,我现在看到其他人已经在我前面回复了。它只是告诉你,总有人比你更聪明。 |