Okay ive solved it, for anyone else with the same issue:
_compReference = [ "BEACH_Village_01", _pos, [ 0, 0, 0 ], dir, true, false ] call LARs_fnc_spawnComp;
_compArray = [ _compReference ] call LARs_fnc_getCompObjects;
{
_x setVectorUp surfaceNormal getPos _x; // only needed if you want the object to allign with terrain
_x setPosATL [getPosATL _x select 0, getPosATL _x select 1, 0];
} foreach _compArray;