problem with pmp

I have some buttons on my pmp. One of these buttons selects a dimension and modifies it or should do that. i created code which runs perfectly if i run it from command tab button. I tried selectbyid2 and select3 which both work if i dont use pmp. If i start pmp and use command button no luck there meaning that there is something with pmp that affects selection.

Is it possible that pmphandler affects it?

I have a chunk of code that runs before that to select right stuff and it all works, but not selecting.

selectbyid2 is from modeldocextension

select3 from annotations

Any advice will be highly welcomed.

SolidworksApi macros