home *** CD-ROM | disk | FTP | other *** search
- ;Base program for the door selection menu
- ;This program only works if the door symbols are there and the layers
- ;are correct.
- ; ********Patrick J. McKee, author********
- ; ****Copyright 1992, Power Key tm****
- ;
- (setq oer *error* *error* err)
- (PRE)
- (if (= os1 nil)(setq os1 36))
- (setq dfop1 os1)
- (initget (+ 2 4))
- (setq os1(getdist(strcat "Enter door size <" (rtos os1) ">: ")))
- (if (= os1 nil)(setq os1 dfop1))
- (initget 1 "Left Right Center")
- (setq ptpk1(getkword "Break from Left/Right/Center: "))
- (setq ent1 (entsel "\nPick break point: "))
- (if(= ent1 nil)(ref))
- (setq e1 (car ent1))
- (setvar "aperture" 4)
- (setq p1 (car (cdr ent1)))
- (setq p1 (osnap p1 "near"))
- (setq lyrn (cdr (assoc 8 (entget e1))))
- (setq startpt (cdr (assoc 10 (entget e1))))
- (setq endpt (cdr (assoc 11 (entget e1))))
- (setq temp1 (osnap p1 "NEAR"))
- (setq atemp (angle (osnap p1 "end") temp1))
- (setq temp1 (polar p1 atemp 8)) ;reset temp1
- (setvar "aperture" 40)
- (entdel e1)
- (setq temp2(osnap temp1 "near"))
- (entdel e1)
- (setvar "aperture" 4)
- (setq up (/ pi 2))
- (setq dn (* pi 1.5))
- (setq a1 (angle startpt endpt))
- (cond((= ptpk1 "Left")(if(and (> a1 up)(<= a1 dn))(setq a1 (- a1 pi))))
- ((= ptpk1 "Right")(if(or (<= a1 up)(> a1 dn))(setq a1 (+ a1 pi))))
- ((= ptpk1 "Center")(setq p1(polar p1 a1 (* (/ os1 2) -1.0)))))
- (setq a2 (angle temp1 temp2))
- (setq p2 (polar p1 a1 os1))
- (setq p3 (polar p1 a2 (distance temp1 temp2)))
- (setq p4 (polar p2 a2 (distance temp1 temp2)))
- (command "layer" "M" lyrn "")
- (command "break" e1 p1 p2)
- (command "break" p3 "f" p3 p4)
- (command "line" p2 p4 "")
- (command "line" p1 p3 "")
- (setq halfwidth (/ (distance p1 p3) 2.0))
- (command "layer" "M" "aw" "")
- (setq dstpt(getpoint "\nPick hinge point of door: "))
- (setq drblk1(strcat "/kesym1/" drblk))
- (COMMAND"LAYER""M""ND""")
- (command "insert" drblk1 dstpt os1 "" pause )
- (POST)
- (princ)