Hi Rafael,
TransmissionData class may help to do that. This class can get and set the file reference information without opening the main Revit file in Revit.
TransmissionData stores information on both the previous state and requested state of an external file reference. This means that it stores the load state and path of the reference from the most recent time this TransmissionData's document was opened. It also stores load state and path information for what Revit should do the next time the document is opened.
As such, TransmissionData can be used to perform operations on external file references without having to open the entire associated Revit document. The methods ReadTransmissionData and WriteTransmissionData can be used to obtain information about external references, or to change that information. For example, calling WriteTransmissionData with a TransmissionData object which has had all references set to LinkedFileStatus.Unloaded would cause no references to be loaded upon next opening the document.
TransmissionData cannot add or remove references to external files. If AddExternalFileReference is called using an ElementId which does not correspond to an element which is an external file reference, the information will be ignored on file load.
Note that TransmissionData objects must be set to "transmitted" for the requested reference data to be meaningful. Revit ignores the TransmissionData for non-transmitted files. Marking a file as transmitted has other effects - workshared files are opened as detached from the central model, and creation of new local files is prohibited, until the file is in its final location and the file has been marked as no longer transmitted.
Several posts in Jeremy's talked about the usage of TransmissionData class and its methods.
http://thebuildingcoder.typepad.com/blog/2011/10/using-the-writetransmissiondata-method.html
http://thebuildingcoder.typepad.com/blog/2011/05/list-linked-files-and-transmissiondata.html
http://thebuildingcoder.typepad.com/blog/2011/10/using-the-writetransmissiondata-method.html
And you can see more posts by searching his blog.
Hope this helps.
Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network