Senin, 24 Januari 2011

Knowledge detail

LISP programming

Q: How so I create LISP applications?
A: The steps to write applications in LISP are as follows:
1. Open a text editor such as NotePad.
2. Write the LISP code in the text editor’s window.
3. Save the code in a file using the desired path and file name. Ensure the extension is SP.
4. Load and run LISP program in ZWCAD with the AppLoad command.
The following LISP program is an example. It creates a layer named “Test,” changes the layer’s color to green, and then draws a closed polyline on the layer.(defun C:testlisp (/)
  (setvar "cmdecho" 0)
  (command "-layer" "t" "test" "m" "test" "c" "green" "test" "l" "continuous"
   "test" "lw" "0.5" "test" "")
  (command "pline" "-2,-3,0" "6, 4, 0" "1, -10, 0" "-11, -9, 0" "-12, -1, 0" "-6, 2, 0" "-1, 7, 0" "c")
  (command "regen")
  (command "zoom" "e" "")
  (setvar "cmdecho" 1)
  (princ)
)

Tidak ada komentar:

Posting Komentar