含糖的公园lsp生成90度停车位:
- ; PARK.LSP Copyright 1989,90,91 Tony Tanzillo All Rights Reserved.
- ;
- ; This program automates the layout of rows of right-angle parking spaces
- ; (or more accurately, the striping for parking spaces). Great for site
- ; planning/layout work. Automatically calculates the reqired stall width
- ; above a specified minimum, to fit the maximum number of stalls into the
- ; specified area.
- ;
- ; No further documentation available, just follow the prompts.
- (defun C:STALL90 ( / +pi/2 -pi/2 sc sw sl sxw st p1 p2 p3 p4 a d l hi bm)
- (setq +pi/2 '((a) (+ a (/ pi 2.0)))
- -pi/2 '((a) (- a (/ pi 2.0))))
- (initget 7)
- (setq sw (getdist "\nMinimum stall width: "))
- (setq sl (getdist "\nStall depth: "))
- (initget 1 "Single Double Double")
- (setq st (getkword "Single- or Double-loaded <Double>: "))
- (initget 1 "Entity Entity")
- (setq p1 (getpoint "\nFirst alignment point/<Entity>: "))
- (cond ( (eq p1 "Entity")
- (setq l (entsel "\nSelect line: "))
- (setq l (entget (car l)))
- (setq p1 (cdr (assoc 10 l))
- p2 (cdr (assoc 11 l))))
- (t (setq p2 (getpoint p1 "\nSecond alignment point: "))))
- (cond ( (eq st "Single")
- (setq p3 (getpoint "\nWhich side of alignment: "))))
- (setq d (distance p1 p2))
- (setq a (angle p1 p2))
- (setq sc (fix (/ d sw)))
- (setq sxw (/ d sc))
- (if p3 (setq p4 (inters p1 p2 p3 (polar p3 (+pi/2 a) 1.0) nil)))
- (princ (strcat "\nDrawing "
- (cond (p3 "") (t "2 x "))
- (itoa sc) " stalls @ " (rtos sxw) " wide x "
- (rtos sl) " deep."))
- (printf "\nDrawing ~i x ~i stalls @ ~d wide x ~d deep."
- (list n sc sxw sl))
- (setvar "cmdecho" 0)
- (setq hi (getvar "highlight"))
- (setq bm (getvar "blipmode"))
- (setvar "highlight" 0)
- (setvar "blipmode" 0)
- (command ".line" p1 p2 "")
- (cond (p3 (command ".line" p1 (polar p1 (angle p4 p3) sl) ""))
- (t (command ".line" (polar p1 (+pi/2 a) sl)
- (polar p1 (-pi/2 a) sl) "")))
- (command ".UCS" "Z" (* a (/ 180.0 pi))
- ".array" (entlast) "" "R" "1" (1+ sc) sxw
- ".UCS" "P"
- )
- (setvar "highlight" hi)
- (setvar "blipmode" bm)
- (princ)
- )
- ; --------------------------------eof park.lsp-------------------------
不过,它不起作用。我已经在AutoCAD 2007 ADT和BricsCAD Classic v9上试用过。两者给出的错误消息大致相同:
- Command: (LOAD "S:/LISP/PARK.LSP") C:STALL90
- Command: stall90
- Minimum stall width: 5
- Stall depth: 20
- Single- or Double-loaded <Double>: single
- First alignment point/<Entity>:
- Second alignment point:
- Which side of alignment:
- Drawing 522 stalls @ 5" wide x 1'-8" deep.; error: no function definition:
- PRINTF
|