The following command closes waveform window in DO macro as well as in TCL:
closedocument -wave
The following command is supported only for the DO mode:
close -wave
In both cases, the waveform window has to be active to be closed. For detailed descriptions of both commands please see AHDL's Help file (On-line Documentation).