I was holding the material that I was drilling and the handle when i got the shock.
It's completely apart now, so I can't really take any pictures of the whole installation.
The earth wire was directly connected to the VFD, and from there to the motor and chassis.
I live on the first floor in an appartment building that probably was built between the two world wars.
I have a bachelor in marine management and technical engeneering, wich includes all the theori a licensed electrical installer would have.
That made me think about equipotential bonding, and I think there is none of it, taken the age of the building in account. It is after all an appartment and not a workshop.
Thanks for the answers guys. I'll seek out an actual electrician and take a look at the problem.