It looks like you have an issue I ran into myself a while ago. If the square box character you need is 25AF in hex then the normal methods of outputting it using MOM_output_literal will always show "#" and not the box: ▯ In my case, I needed this code as the end-of-code character for a post, so I created a proc with the code shown below:
# Close the ptp file and append the required control character to the
# end of the file.
set fid [open $::ptp_file_name a]
puts $fid [format "%c" 0x25af]
I located this proc at the very end (i.e. bottom) of the End-of-Program block of the Program-End-Sequence.
Please note that the NX Information Window does not display this output correctly, so after posting, the control character will look wrong - something like this:
However, the output file saved on the OS does contain the correct code – do not use the output in the Information window to post to your machine.