Thanks for your EnlInt reply, but I do not know much about VB Script. I tried to change the code, but it does not work. I will try to see this with a friend who knows the VB Script.
For the BDMackey response:
The purpose of what I want to do by changing the code is not to rename the files. I have applications for this.
I want Revit to save families with a different name. Because when saving a family or project with the same name, the file automatically gains weight.
Take the test with a family. Open it and save it with the same name (just the save command). You will see that your file has gained weight.
While if you do "save as", the file will not gain weight, maybe see decrease.
In fact, in each file, Revit maintains a sort of history which it deletes when the name of the file changes (because it is a new file and therefore without history). The same applies to project files.
There is also a 'compact' option in the recording options, but it is not always as efficient as recording with a new name.
If the BDMackey script allowed families to be renamed with a new name, the files would not gain weight. Because just on a family it is not too serious if the file has gained weight. But when you insert hundreds of families into a project, the weight of the families accumulates and makes the model of the project more cumbersome.
After the script has upgraded all the families by saving them with a new name (a prefix for example), we would have to do the housework in our family library using one of the many software that is found everywhere On the internet for:
- delete all files from families that do not have the prefix
- then use a software program to remove the prefix from the name of the family files upgraded.
And our family library would be perfect ...
Sorry if my English is not perfect. I hope that my answer is understandable all the same.