As far as I know the only way to rename a Part from a higher level file is to use the typical re-name methods in the Assembly. Either single-click on the file name in the tree followed by F2, or a slow double-click on it.
Are you intending on running this on legacy files? SW won't let you change the filename while the file is open as far as I know. Also, you want to be careful when changing filenames. You'll need to retain all references or your assemblies will fall-over.
I think the SW-filename property might be difficult to over-write as well, it likely just reads the filename...... so a better approach may be to change the filenames first. In which case you might find this useful Macro to rename files according to excel cells
That macro looks interesting. I'll have to look around and see if anyone on that thead came up with a way to maybe batch edit the drawing with the assembly closed and then automatically rebuild the references when the assembly gets opened back up.
What I'm thinking is
- Create the Excel
- use the macro to rename the files. (the SW-filename field is now sorted)
- open and update the drawings. Again you could macro that. or use #TASK
The references will only be an issue if you have files scattered through multiple locations. If you have multiple locations but know them, you can add them to System Options > File Locations > Referenced Documents