1. ;;; Function gp:getPointInput will get path location and size
    2. (defun gp:getPointInput ()
    3. (alert
    4. "Function gp:getPointInput will get user drawing input"
    5. )
    6. ;; For now, return T, as if the function worked correctly.
    7. T
    8. )
    9. ;;; Function gp:getDialogInput will get path parameters
    10. (defun gp:getDialogInput ()
    11. (alert
    12. "Function gp:getDialogInput will get user choices through a dialog"
    13. )
    14. ;;For now, return T, as if the function worked correctly.
    15. T
    16. )
    17. ;;; Function gp:drawOutline will draw the path boundary
    18. (defun gp:drawOutline ()
    19. (alert
    20. (strcat "This function will draw the outline of the polyline"
    21. "\nand return a polyline entity name/pointer."
    22. )
    23. )
    24. ;; For now, simply return a quoted symbol. Eventually, this
    25. ;; function will return an entity name or pointer.
    26. 'SomeEname
    27. )
    28. ;;; Function C:GPath is the main program function and defines the
    29. ;;; AutoCAD GPATH command.
    30. (defun C:GPath ()
    31. ;; Ask the user for input: first for path location and
    32. ;; direction, then for path parameters. Continue only if you have
    33. ;; valid input.
    34. (if (gp:getPointInput) ;
    35. (if (gp:getDialogInput)
    36. (progn
    37. ;; At this point, you have valid input from the user.
    38. ;; Draw the outline, storing the resulting polyline
    39. ;; "pointer" in the variable called PolylineName.
    40. (setq PolylineName (gp:drawOutline))
    41. (princ "\nThe gp:drawOutline function returned <")
    42. (princ PolylineName)
    43. (princ ">")
    44. (Alert "Congratulations - your program is complete!")
    45. )
    46. (princ "\nFunction cancelled.")
    47. )
    48. (princ "\nIncomplete information to draw a boundary.")
    49. )
    50. (princ) ; exit quietly
    51. )
    52. ;;; Display a message to let the user know the command name.
    53. (princ "\nType gpath to draw a garden path.")
    54. (princ)

    如果没有特别指定的值,例如“T”,方程会返回方程内最后一个语句的结果,在上面中,许多会返回一个“nil”

    定义方程时,加入的参数“/”代表使用局部变量。