Get Parent Assembly Filename / Part Number

Before I go reinventing the wheel, can anyone think of a method to get a files parent assembly filename or partnumber via a variable? I don't think it's possible but I figured I would ask before I start with the API. I'd like a variable to be populated with the parent assembly in our BOMs.

Thoughts?

SolidworksSolidworks Pdm enterprise Pdm