Get the instance ID from a part or an assembly document

Hi All,

I have been doing a great deal of searching and looking and have had no luck in getting the instance ID from a documnet (Part1-"ID").

I am trying to use the  "GetComponentByName" function so i dont have the component2 only the modeldoc2.

If somebody would be so kind as to shed some light that would be greatly appreciated.

Thanks.

SolidworksApi macros