The responses to the prompts in the BHATCH commands are incorrect. You should run it manually at the command line, and note the sequence of what it asks for and in what order. Do it within a (command) prompt:
(command "_.bhatch")
to start it off and leave you in the command, because some commands work a little differently there than when just typed at the command line.
Mostly, you don't account for the Scale prompt. And you don't seem to have enough Enters to tell it you're done with various things. Try [and study what's different about] this:
(defun c:RecHatch (/ prevlayer pt)
(setq prevlayer (getvar 'clayer))
(command
"_.layer" "_t" "ISE_Hatch,ISE_Outline BRG" "_m" "ISE_Hatch" "_m" "ISE_Outline BRG" ""
"_.rectang"
)
(while (> (getvar 'cmdactive) 0) (command pause)); finish rectangle
(command
"_.bhatch" "_s" "_l" "" "_p" "ansi31" "" "45" ""
"_.chprop" "_l" "" "_la" "ISE_Hatch" ""
)
(while (setq pt (getpoint "\nSpecify first corner point or <exit>: "))
(command
"_.rectang" "_none" pt pause
"_.bhatch" "_s" "_l" "" "_p" "ansi31" "" "" ""
"_.chprop" "_l" "" "_la" "ISE_Hatch" ""
)
)
(setvar 'clayer prevlayer)
(princ)
)
But you probably should say something about the scale, rather than just accepting the default as the above does. Who knows what that might be at a given time?
Also, the first one seems to be just like the continuation of more after that. Is there some reason it couldn't be within one (while) function -- just the followup repeating round, without the separate first round? Is there supposed to be something different about the first one?
And I would suggest you investigate using HATCH instead of BHATCH -- it seems more direct about it, to me. And also the use of a User-specified pattern, so you can just tell it directly the line spacing and angle you want, instead of monkeying around with how ANSI31 is defined and compensating from there. It's silly to tell it to use ANSI31 at 45° to get your lines vertical -- with a User-defined pattern, you can tell it 90° outright.
Kent Cooper, AIA