Perhaps I need to better understand the exact process you're going through, and more specifically which documents you're wanting the code to effect, and at what times.
I am assuming you're starting out with a Multi-body Part file. Then, either selecting all the bodies (in the "Solid Bodies" folder), right clicking, and choosing "Make Components" from that right click menu, or going to the Manage tab and clicking the Make Components tool button, then selecting the bodies from the Solid Bodies folder. Is that right?
Then you're telling the dialog box to "Insert components in target assembly", specifying your assembly name, template file, path, and clicking Next. Right?
Are you specifying new component names within this secondary dialog box, or accepting the default computer generated ones? The component names specified in that dialog will become the individual part's file names.
Now the new assembly is open, and you have to save it at least once before the individual part files are generated, right?
Now are you wanting to change the names of the components within this assembly?
Do you want to change name of the Derived Part Feature below the Origin folder within the newly generated individual part files?
Do you want to change the names of the items in the Solid Bodies folder of the newly generated individual part files?
Or some combination of these options?
Do you maintain, suppress, or break the links between the derived parts and the original multi-body parts?
Do you need to access any of the iProperties of any of the files involved, as part of the re-naming process?
Wesley Crihfield
(Not an Autodesk Employee)