I don't think what you want to do is possible. I tested it in a loop and had to use weaponholder to detect the weapon and the model comes back as "dummyweapon".
Code I used
while {true} do{
_mypos = position player;
_weapons = _mypos nearObjects ["weaponholder", 10];
_HMMWV = _mypos nearObjects ["HMMWV", 10];
_weapondis = _mypos distance _weaponpos;
Hintsilent format ["Mypos %1\n Rifles %2\n HMMWV %3", _mypos, _weapons,_HMMWV];
};