2012年9月27日 星期四

任一轉角正方形

(DEFUN C:rect()
(SETVAR "CMDECHO" 0)
(SETQ DIS (GETDIST "\n Width:"))
(SETQ CL (GETVAR "CLAYER"))
(SETQ ANG (GETreal "\n Rotate Angle: "))
(SETQ SP (GETPOINT "\nPICK LOWER LEFT CORNER :"))
(SETQ P2 (POLAR SP (DTR ANG) DIS))
(SETQ P3 (POLAR P2 (DTR (+ ANG 90.0)) DIS))
(SETQ P4 (POLAR P3 (DTR (+ ANG 180.0)) DIS))
(COMMAND "LAYER" "M" "DOOR" "C" "YELLOW" "" "")
(COMMAND "LINE" SP P2 P3 P4 "C")
(SETVAR "CLAYER" CL)
)


(DEFUN DTR (a)
(* Pi (/ a 180.0))
)

(PRINC)

沒有留言: