If you have the instance id of the instance, you can access all the shapes by doing:
or on each layer purpose pair by doing:
M1=car(exists(lpp instId~>master~>lpps lpp~>layerName=="Metal1" && lpp~>purpose=="drawing"))
of course, having got the shapes, you can find out the ~>bBox of each or whatever you want. The "coordinates of a layer" is a bit vague, so it's not obvious what you want to do with them.
You might need to use dbTransformPoint or dbTransformBBox of points or bounding box with instId~>transform as the second argument if you want the coordinates referred to the cellView the pcell is instantiated in, otherwise they are relative to the origin of the pcell.