You need the position closest to the map building or object you want to destroy, so you should place a gamelogic or a marker quite close to it, lets suppose your logic is name "log_target" and the map object is 112234:
// SQF code
_object = (getPos log_target) nearestObject 112234;
if (!isNull _object) then
{
_object setDamage 1;
};
// SQS code
_object = (getPos log_target) nearestObject 112234
? !isNull _object: _object setDamage 1