;mhatch V1.1 copyright 2001 Bill DeShawn ;Bill DeShawn will not be responsible for any damage brought on by this ;routine. Use it at your own risk. Do not eat this program. It contains lead. ; (defun myerr (msg) (if c:r (c:r) (redraw)) (setvar "cmdecho" cmde) (setq p1 nil sset nil hatches nil method nil cmde nil ans nil index nil) (setq *error* olderr) (princ msg) (command "_.undo" "_end") (prompt ". Please try again.") (princ) ) (defun c:mhatch (/ p1 sset hatches method cmde ans index) (command "_.undo" "_g") (setq olderr *error* *error* myerr) (setq cmde (getvar "cmdecho")) (initget 1 "S I") (setq method (getkword "\nelect objecst or pick nternal points? : ")) (setvar "cmdecho" 1) (setq index 0) (if (= method "I") (while (null p1) (command "bhatch" (setq p1(getpoint "\nSelect Internal Point: ")) "") (if (null sset) (setq sset (ssget "l"))) (if (> index 0) (setq hatches (ssadd (entlast) sset)) ) (setq p1 nil) (initget 1 "C X") (setq ans (getkword "\nContinue or eXit? : ")) (if (= ans "X")(setq p1 T)) (setq index (1+ index)) ) ) (if (= method "S") (while (null p1) (if (null sset) (setq sset (ssget "l"))) (if (> index 0) (setq hatches (ssadd (entlast) sset)) ) (command "bhatch" "s" (setq p1(car(entsel "\nSelect Object: "))) "" "") (setq p1 nil) (initget 1 "C X") (setq ans (getkword "\nContinue or eXit? : ")) (if (= ans "X")(setq p1 T)) (setq index (1+ index)) ) ) (command "_.draworder" hatches "" "b") (if (= method "S")(command "_.draworder" "l" "" "b")); for an unknown reason, this line was necessary. (setvar "cmdecho" cmde) (setq *error* olderr) (setq p1 nil) (command "_.undo" "_end") (princ) );end of mhatch.lsp (princ "\nMhatch.lsp by Bill DeShawn V.1.1 - Loaded! Tested in AutoCAD 2000. ")(princ)