How to update full path of a reference attachment


I'd like to change the path and also update contents of a reference. I know MS_RFDIR helps to locate the new references but I want to overwrite the path of a drawings as I am also updating the content of reference without re scale/rotate/locating the drawing.

i.e. A.dgn is a blue box (with set location/scale/rotation) and I want to replace A.dgn with B.dgn (which is a red box with same attachments settings of location/scale/rotation. etc.) while keeping both original files untouched in two different paths and using these paths for any reattachment methods.

I heard .Reattach() and .Rewrite() methods might help but I need help with how to use them.