Is it possible for you to use "pack and go" command in SW? I think it will do what you are describing.
Well, Pack and Go would be good if I were doing it all at once, but I'm basically doing my design, then coming back weeks or possibly months later to re-reference a new part to a newly-made copy of an old drawing.
I think basically what I need is a macro to:
1 - Look for drawing file of same file name as part that is open.
2 - Get referenced model path from within drawing file.
3 - Open drawing file with command to re-reference from old part file to new part file.
4 - Profit.
If I understand your steps correctly, all you need to do is open the drawing. Two different part files with the same filename (even different path) cannot be open at the same time. If the filename of the old part and new part are the same, then when you open the drawing SolidWorks will automatically reference the file you have open. Then when you save the drawing (using save-as, of course, or you will overwrite the original drawing) it will reference the new path.
You are correct in your process, but unfortunately my file names (and locations) both change throughout the process.
I save-as A.SLDPRT to B.SLDPRT during initial design stages, then later do a save-as for A.SLDDRW to B.SLDDRW. The problem is the B.SLDDRW still references A.SLDPRT, even when I 'Open Drawing' from B.SLDPRT.
I understand that the SW "pack and go" function not work for you at this moment but I saw a past thread;
And it lead me to this VBA code
when I ran the code it renamed the parts and not with a suffix or prefix but the entire file name was changed. Perhaps these two links will be a good jump off for you to modify the code per your specific needs per file name and file type.