I have a file, say myInclude.puml, which defines a constant, say !define FORMAT_LONG and also a macro which, depending on the constant, produces different outputs. If I include myInclude.puml in another file, !undef the constant there and call the macro, I always get the output as if the constant was still defined.
The macro works because if I put !undef FORMAT_LONG anywhere in myInclude.puml (after !define FORMAT_LONG of course), then the proper output is returned.
It seems as if undefining a constant only works in the file where it was defined and not across included files.