Adi:
Briefly:
1. Open the library part and add two new parameters by clicking on the "New" button.
2. Give each of these parameters a unique Variable (like Mat_A and Mat_B), give each one a descriptive Name, and change their Type to Material (icon with a cube & sphere).
3. Now the fun starts. You will need to search through the 3D Script and find where ArchiCAD placed the material designation for each part of your object. ArchiCAD should have used the material assigned to each part when you created the library part, so search for these material names. You will want to substitute these material names with your Variable names. The material names will probably be in quotes (as it is using the name, not the index number), your Variable name should not be in quotes (as it is actually passing the index number, not the name).
Post the code if you really get stuck, depending on the primitives used (object, slab, etc) the material names may appear near the start of each part, or somewhere in the middle.
[I saw your reply after writing, but posted this as it might help others]
HTH
David