The easiest way is if you have rules that always can tell what the filename of the drawing would be. Then your idea is quite easy to implement. Note that drawings and assemblies can have same filename since they have different file extensions. So you do not have to do TCP....+1 for the drawing.
The downside with this is that as soon something deviates from the rules or if the assembly is referenced to multiple drawings. Then the drawing(s) won't be found.
To cover all scenarios, you have to go through all drawings and check if the assembly is referenced. Quite time consuming... the function would be similar as the one you can use in Solidworks Explorer. But triggered with API.