All skyscrapers have their lowest foundations lying 20-30 meters beneath the Earth surface. So, it is possible to calculate a position of a "zero-box" under such a skyscraper in such a way that a nuclear explosion would produce a cavity upper end of which would not reach the Earth surface, but would reach only the lowest underground foundation of a skyscraper it intends to demolish.
For example, in particular cases of the Twin Towers of the World Trade Center in New York, their lowest underground foundations were 27 meters beneath the surface. While the 150 kiloton thermo-nuclear demolition charges were positioned as depths of 77 meters (measuring from the surface), or 50 meters below their underground foundations. Such a thermo-nuclear explosion at a depth of 77 m would create an extremely overheated cavity with its upper sphere touching the lowest underground foundations of the Twin Tower it intends to demolish. But it would still be short of reaching the Earth surface by 27 meters - so surrounding structures would not to be affected by any destructive factors of this underground nuclear explosion (except by, possibly, only its radioactive contamination). The Tower that is to be demolished supposes to lose its foundations completely, and to be sucked-in into this overheated cavity, temperatures inside of which are deemed enough to melt the entire Tower. Nuclear demolition schemes of the WTC building # 7 and that of the Sears Tower in Chicago were calculated in the same way.