Using Costing Stock Weight as a Custom Property

Has anyone used an API to determine the stock weight from SWCosting stock size into a custom part property? Right now, I can generate a Costing Report that displays the Stock weight, but there is not a Custom Property that allows me to put it into the part that I could use for the BOM or to import into our ERP software. I'm new to API and could use a little direction if anyone has any. I see from API Help, there is Density Property (IMassProperty) that I can use for density and BlankSize Property (ICostAnalysisMachining) that I believe can return the stock size array. I'm just not sure how to get started. Thanks.

SolidworksApi macros