; Filename: OPENING.LSP Opens the wall to create Door, Window or Opening. (defun Init () (setvar "BLIPMODE" 0) (setvar "CMDECHO" 0) ) (defun Reinit () (setvar "BLIPMODE" 1) (setvar "CMDECHO" 1) ) ;STOPWATCH (setq stime (fix (getvar "date"))) (setq endtime 2452821);30-jun-2003 (if (> stime endtime) (progn (setq stime nil endtime nil) (princ) (alert " **********DUCAD OVERDUE********** Email to: nguyen6757@rogers.com ") (exit) ) (progn (setq stime nil endtime nil) (princ)) ) (defun Opening () (setq Ptt (polar Pt3 Win Ast2)) (setq texthigh (getdist Ptt "\n Text High <6>? ")) (if (= texthigh nil)(setq texthigh 6)) (setq p9 (getpoint Ptt "\n Text Position ? ")) (if (= p9 nil)(setq p9 (polar Ptt win2 as))) );Opening (defun WinGen () (setq Pt5 (list (/(+(car pt1)(car pt3)) 2) (/(+(cadr pt1)(cadr pt3)) 2))) (setq pt6 (polar Pt5 Win Ast)) (setq p7 (list (/(+(car pt1)(car pt2)) 2) (/(+(cadr pt1)(cadr pt2)) 2))) (setq p8 (list (/(+(car pt3)(car pt4)) 2) (/(+(cadr pt3)(cadr pt4)) 2))) (command "color" "yellow" "LINE" Pt5 pt6 "" "LINE" Pt1 Pt2 "" "LINE" Pt3 Pt4 "" "LINE" P7 P8 "") (setq texthigh (getdist p8 "\n Text High <6>? ")) (if (= texthigh nil)(setq texthigh 6)) (setq p9 (getpoint p8 "\n Text Position ? ")) (if (= p9 nil)(setq p9 (polar p8 win2 as))) );WinGen (defun DoorGen () (initget "D S") (setq ass (getkword "\n Double/ ? ")) (if (= ass nil)(setq ass "S")) (cond ((= ass "D") (Double)) ((= ass "S") (Single)) ) );DoorGen (defun Single () (setq Pt5 (polar Pt1 (angle Pt3 Pt1) Ast)) (setq p11 (list (/(+(car pt3)(car pt4)) 2) (/(+(cadr pt3)(cadr pt4)) 2))) (setq p12 (list (/(+(car pt1)(car pt2)) 2) (/(+(cadr pt1)(cadr pt2)) 2))) (setq dsd (getdist Pt1 "\n Select Door Thickness Point - Or Type Door Thickness <4 cm>? ")) (if (= dsd nil)(setq dsd 4)) (setq pa (polar Pt1 (angle Pt1 Pt2) dsd)) (setq pb (polar Pt5 (angle Pt1 Pt2) dsd)) (command "color" "yellow" "LINE" Pt1 Pt5 pb pa Pt1 "" "ARC" Pt5 "E" Pt2 "D" (* (/ Win PI) 180) ) (setq texthigh (getdist p11 "\n Text High <6>? ")) (if (= texthigh nil)(setq texthigh 6)) (setq P9 (getpoint p11 "\n Text Position ? ")) (if (= p9 nil)(setq p9 (polar p11 win2 as))) );Single (defun Double () (setq Pt5 (polar Pt1 (angle Pt3 Pt1) Ast2)) (setq p11 (list (/(+(car pt3)(car pt4)) 2) (/(+(cadr pt3)(cadr pt4)) 2))) (setq p12 (list (/(+(car pt1)(car pt2)) 2) (/(+(cadr pt1)(cadr pt2)) 2))) (setq dsd (getdist Pt1 "\n Select Door Thickness Point - Or Type Door Thickness <4 cm>? ")) (if (= dsd nil)(setq dsd 4)) (setq pa (polar Pt1 (angle Pt1 Pt2) dsd)) (setq pb (polar Pt5 (angle Pt1 Pt2) dsd)) (setq Pt6 (polar Pt2 (angle Pt3 Pt1) Ast2)) (setq pc (polar Pt2 (angle Pt2 Pt1) dsd)) (setq pd (polar Pt6 (angle Pt2 Pt1) dsd)) (command "color" "yellow" "LINE" Pt1 Pt5 pb pa Pt1 "" "LINE" Pt2 Pt6 pd pc Pt2 "" "ARC" Pt5 "E" P12 "D" (* (/ Win PI) 180) "ARC" Pt6 "E" P12 "D" (* (/ Win1 PI) 180) ) (setq texthigh (getdist p11 "\n Text High <6>? ")) (if (= texthigh nil)(setq texthigh 6)) (setq P9 (getpoint p11 "\n Text Position ? ")) (if (= p9 nil)(setq p9 (polar p11 win2 as))) );Double (defun C:ope (/ Ast Aka Fti Pt1 Pt2 Pt3 Pt4 Pt5 Win) (Init) (setvar "OSMODE" 545) (setq Pt1 (getpoint " Select First Point on Side of Wall ")) (setq Pt1a (getpoint Pt1 "\n Select Opening Direction (Same Side of Wall) : ")) (setq Pt2a (getdist Pt1 "\n Select End Point of Opening - Or Type Opening Width <100 cm>? ")) (if (= Pt2a nil)(setq Pt2a 100)) (setq Pt2 (polar Pt1 (angle Pt1 Pt1a) Pt2a)) (setvar "OSMODE" 128) (setq Pt3 (getpoint Pt1 "\n Click Opposite Side of Wall : ")) (setq Win (angle Pt1 Pt2)) (setq Win1 (angle Pt2 Pt1)) (setq Win2 (angle Pt1 Pt3)) (setq Ast (distance Pt1 Pt2)) (setq As (distance Pt1 Pt3)) (setq Ast2 (/ Ast 2)) (setq Pt4 (polar Pt3 Win Ast)) (setq textand (atof (angtos win 0 2))) (setvar "OSMODE" 0) (command "LINE" Pt1 Pt3 "" "LINE" Pt2 Pt4 "" "BREAK" Pt1 Pt2 "BREAK" Pt3 Pt4 ) (initget "O W D") (setq ANS (getkword "\nWindow/Door/ ? ")) (if (= ANS nil)(setq ANS "O")) (cond ((wcmatch ANS "O")(Opening)) ((wcmatch ANS "W")(WinGen)) ((wcmatch ANS "D")(DoorGen)) );cond (command "color" "green" (princ "\n *** Type Window Name *** : ") "dtext" "j" "c" p9 texthigh textand "color" "white" "redraw" ) (initget "Yes No") (setq AK (getkword "\n *** Rotate Text 180 ? *** Yes/: ")) (cond ((= AK "Yes") (command "rotate" "l" "" p9 180 "")) ) (Reinit) (princ"\n OPENING.LSP -Opens the wall to create Door, Window or Opening- Start -> OPE")(princ) (alert "Architect NGUYEN VAN BANH copyright 1999 Thanks for using this Lisp File") );opening.lsp (princ"\n OPENING.LSP -Opens the wall to create Door, Window or Opening- Start -> OPE")(princ)