Dear All
plz chk program & suggestion me how to imrove
program run only mm drg
System Variables not restore what's problem
door lisp-
- (DEFUN C:DR (/ lu a b c d e f g pt pp pt1 pt2 p ang1 tz wl ds wt sw ang2
- pt3 pt4 ang3 pl2 pl3 pl4 pl5 pl6 pt5 pt6 pt7 pt8 pt9 pt10 pt11 pt13 pt14 pt15)
- (SETVAR "BLIPMODE" 0)
- (SETVAR "OSMODE" 512)
- (setq lu (getvar "lunits"))
- (if (= lu 2) (setq a 75 b 82 c 15 d 38 e 60 f 120 g 150)
- (setq a 3 b 3.5 c 0.5 d 1.5 e 2.5 f 5 g 6))
- (if (null DRlay)
- (progn
- (setq DRlay "DR")
- (setq DRlayer (tblsearch "layer" DRlay))
- (if (null DRlayer)
- (progn
- (setq DRlay (getstring "\nLayer name for TEXT : "))
- (setq DRclr (getstring (strcat "\nColor for " DRlay " layer: ")))
- (command "layer" "m" DRlay "c" DRclr "" "")
- )
- (prompt "\nDOOR ON DR LAYER")
- )
- )
- )
- (SETQ PT (entsel "\nPICK WALL LINE:"))
- (setq pp (CDR (ASSOC 11 (ENTGET (CAR PT)))))
- (setvar "osmode" 128)
- (SETQ PT1 (GETPOINT PP "\nEnter Insertion Point:"))
- (SETQ PT2 (GETPOINT PT1 "\nPick Opposite Wall Line:"))
- (SETVAR "OSMODE" 512)
- (SETQ p (GETpoint PT2 "\nPICK THE SIDE FOR OPENING:"))
- (setq ang1 (angle pt2 p))
- (IF (null DZ) (SETQ DZ "900"))
- (SETQ TZ (STRCASE (GETSTRING (STRCAT "\nENTER SIZE OF OPENING <" DZ ">: ")) t))
- (IF (/= TZ "") (SETQ DZ TZ))
- (SETVAR "BLIPMODE" 0)
- (setq wl (cdr (assoc 8 (entget (car pt)))))
- (SETQ DS (Atof DZ))
- (SETQ WT (DISTANCE PT1 PT2))
- (SETQ SW (- DS f))
- (SETQ ANG2 (ANGLE PT1 PT2))
- (SETQ PT3 (POLAR PT1 ANG1 DS))
- (SETQ PT4 (POLAR PT3 ANG2 WT))
- (SETQ ANG3 (ANGLE PT3 PT1))
- (SETQ PL2 (POLAR PT1 ANG1 a))
- (SETQ PL3 (POLAR PL2 ANG2 b))
- (SETQ PL4 (POLAR PL3 ANG3 c))
- (SETQ PL5 (POLAR PL4 ANG2 d))
- (SETQ PL6 (POLAR PL5 ANG3 e))
- (SETQ PT5 (POLAR PT1 ANG1 (/ DS 2)))
- (SETQ PT6 (POLAR PT5 ANG2 f))
- (SETQ PT7 (POLAR PL5 ANG1 SW))
- (SETQ PT12 PT7 PT13 PL5)
- (SETVAR "OSMODE" 0)
- (COMMAND "BREAK" Pt "F" PT1 PT3)
- (COMMAND "BREAK" P "F" PT2 PT4)
- (COMMAND "LAYER" "s" WL "")
- (COMMAND "LINE" PT1 PT2 "")
- (COMMAND "LINE" PT3 PT4 "")
- (COMMAND "COLOR" "BYLAYER")
- (COMMAND "LAYER" "t" drlay "on" drlay "s" drlay "")
- (COMMAND "PLINE" PT1 PL2 PL3 PL4 PL5 PL6 "")
- (COMMAND "MIRROR" PL2 "" PT5 PT6 "")
- (SETVAR "ORTHOMODE" 0)
- (SETQ PT11 (GETPOINT PT5 "\nPICK THE SIDE FOR SHUTTER:"))
- (IF (> (DISTANCE PT11 PL5)(DISTANCE PT7 PT11)) (SETQ PL5 PT7 PT12 PT13))
- (SETQ PT8 (POLAR PL5 (ANGLE PL5 PT6) d))
- (SETQ PT9 (POLAR PT8 ANG2 SW))
- (SETQ PT10 (POLAR PT9 (ANGLE PT6 PL5) d))
- (COMMAND "PLINE" PL5 PT8 PT9 PT10 PL5 "")
- (COMMAND "ARC" PT12 PT9 PT10)
- (COMMAND "CHPROP" "L" "" "LT" "HIDDEN2" "")
- (setq pt14 (polar pl3 ang1 (- ds g)))
- (setq pt15 (polar pl2 ang1 (- ds g)))
- (if (and (>= ds 100) (<= ds 750)) (command "line" pl3 pt14 ""))
- (if (>= ds 910) (command "line" pl2 pt15 ""))
- (if (<= ds 32) (command "line" pl3 pt14 ""))
- (if (and (>= ds 37) (< ds 100)) (command "line" pl2 pt15 ""))
- )
window lisp |