如果您想学习LISP的基础知识,请查看以下几点:
http://www.cadtutor.net/forum/showthread.php?t=38760
http://www.cadtutor.net/forum/showthread.php?t=38734
http://www.afralisp.net/
http://www.jefferypsanders.com/autolisptut.html
http://ronleigh.info/autolisp/index.htm
http://midpointcad.com/au/docs/lakose_The_Visual_LISP_Developers_Bible.pdf
但为了让您开始,这可能是使用LISP插入块的最简单方法:
- (defun c:ins (/ blk iPt)
- (setq blk "programstamp") ;; Block Name
- (cond ((not (or (tblsearch "BLOCK" blk)
- (setq blk (findfile (strcat blk ".dwg")))))
- (princ "\n** Block Not Found **"))
- ((setq iPt (getpoint "\nSelect Point for Block: "))
- (command "_.-insert" blk "_non" iPt 1. 1. 0.)))
- (princ))
注意:-这可以通过使用错误处理程序等在许多方面进行改进-但让我们从简单的事情开始
李 |