AutoLISP:如何解决没有函数定义错误?

时间:2013-06-09 16:52:32

标签: functional-programming lisp autocad autolisp

下面我粘贴了drawmycoil.lsp文件中的代码。

(defun drwcoil ()
  (setq helices_center '(0 0)) ; this is the center of the helices
  (setq inner_radius 1e3)      ; 1000 microns
  (setq outer_radius 2.4e3)    ; 2400 microns
  (setq coil_thickness 35)     ; 35 microns
  (setq turns (\ (- outer_radius inner_radius)
                 (* coil_thickness 2))) ; coil_thickness is multiplied by 2 to
                                        ; account for coil spacing
  (while (< inner_radius outer_radius)
    (command "HELIX"
             helices_center
             inner_radius
             (+ inner_radius (* coil_thickness 2))
             "t"
             "1"
             "0") ;draws one helix per iteration
    (setq inner_radius 
          (+ inner_radius (* coil_thickness 2))))) ; increments the inner radius
                                                   ; for the next iteration

(defun c:drawmycoil ()
  (drwcoil)
  (princ))

这是加载并执行后的lisp文件的输出:

Command: _appload coil35um_intricate.lsp successfully loaded. 

Command: 

Command:  

Command: drawmycoil  ; 
error: no function definition: \\\\

尽管已明确定义了我的功能,但我无法使AutoCAD / AutoLISP识别它们。我正在使用Autodesk Education Master Suite 2011.我看到了很多教程网站,其中大多数都专注于LISP部分的功能。我更专注于通过LISP让AutoCAD绘制我的绘图。

1 个答案:

答案 0 :(得分:3)

从帖子中查看此代码:

(setq turns (\ (-

我怀疑您打算使用/代替\