If Any part file of Siemens Nx faces with different colors and want to know the surface area of the same colored faces(like below image).
This code can do that for us.
After running the dll file. First select the required colored face to calculate the total surface area that colored faces in part(like below image).
Calculated Total surface area of the select colored faces is show in Listing window(like below image).