Solidworks drawing still display X, after change directory and replacereference

After I change the directory of solidworks model, solidworks drawing display X.

I use "swApp.ReplaceReferencedDocument" to update the rigth directory of model position, but it is stll X in the solidworks drawing. How I can correct it.

It's better not to open the file.

Best Regards!

SolidworksApi/macros
Answers 3
NP
NP 2021-04-09 Best Answer

This can also be done using Document Manager API. Try ISwDMDocument::ReplaceReference method.

NP
NP 2021-04-09

With Document Manager API, you don't need to open a single file. 

KH
KH 2021-04-09

Thanks for your help!

But I do not want to open the file, because I have many file to replacereference, if I need to open every file, it will become very slowly.