A very quick way to check the number of any object on a base (including town buildings), is to do a .dt query on an undamaged base of the same type.
You get back the number of objects in hex format.
As far as I can see, it#s only somewhat tricky with vehicle bases, as there are (at least?) two types of such bases with the same icon.