In Sm2Co17 based magnets the coercive field is determined by the repulsive or attractive interaction of domain walls with the 1:5 cell walls. With increasing temperature the coercivity mechanism changes from repulsive to attractive pinning and above the Curie temperature of the cell walls a nucleation mechanism may be dominant.