How to forbid traces under component in Diptrace?
I am not familiar with Diptrace, but look for "keepout" in the documentation.  You want to define keepout areas for each component.

An alternate way to do this is to draw copper shapes under each component, such that the autorouter will not be able to use that space.  Then delete the shapes after autorouting.