I need to read material from catalogue code i got 3 part component and the reason i need this is that 1 of the component does pocket operation on the other so replacing it with new file is not an option as the operation is gone (i tried it already).

If you want to change your custom materials using catalog headers you have to go to file topmaterials.xml and take the name and put in to .cat file as per the below example. Where "X" is the part name.

Simple as that and it works

@ UPDATED

The key point for this to work is that you set name for the part you want to change the material. Image attached