Use API to obtain custom properties of currently selected part in an assembly

When in an assembly, the Custom Properties tab displays the data for the assembly. However, if I click on, say a fastener from the Feature Manager Design Tree, then click the Custom Properties tab displays the properties for the selected fastener.

I would like to know the proper API calls to get the Custom Properties of the currently selected part (as currently selected in the Feature Manager).

I know how to obtain the Custom Properties given the correct ModelDoc2, I just haven't been able to figure out how to get the ModelDoc2 of the currently selected part in the Feature Manager tree.

Thanks for your help!

Dave B.

SolidworksApi macros