Simple API Help

Hello I am using a Macro currently that does a bounding box feature, I got this from a user here. I am looking to add a little more to it now, however I don't know how API works. I am somewhat experienced with C and C++ language, and can kind of sort understand the program language, however getting info out of SolidWorks, I don't know what's the protocol.

What I am trying to accomplish is to add a new property that is dependent on the material. So I just need about 6 If's statements. Kinda copying and pasting what I have in the macro, this is what I am trying to achieve.

retval = Part.AddCustomInfo3(ConfigName, "Treatment", swCustomInfoText)                                   // Adds a new property called "Treatment" in the Properties > Configuration Specific

If getPartMaterial = "A2" Then                                                                                                             // Check for the part material (I don't know what function to use here)

  retval = Part.AddCustomInfo3(ConfigName, "Treatment", swCustomInfoText, "R/C 56 MIN")          // If the material is A2, then it will fill the text with "R/C 56 MIN"

End if

That's what I am basically trying to achieve, I just need some fine tuning because API is not familiar to me. Thanks.

SolidworksApi macros