Using Quickfort #build for Magma Forges/Smelters/etc are only valid on invalid tiles
Example:
Digging the channels for magma access:
#dig ,h,,,h,,,h,,,h,,,h
The Smelters
#build ,el,,,el,,,el,,,el,,,el
If used in order, the Smelters cannot be placed. You can however place the blueprint on invalid tiles but they won't function nor can you dig under them.