Rename Project with included files

Wow, very helpful of you guys but this is getting more and more complicated! When this thread was started just the simple “Save As” (exactly as it is in most modern computer programs) was wished for. Now it has grown like a bible with maybe too many pages :slight_smile:

1 Like

BlackCoffee

1

3h

I do this quite often (did it three times this morning). Maybe helpful…

Here’s my scheme for doing it:

• Existing project named Tofu-InProcess, everything is finished and I want to Rename it and all the related files having the Same Name.
Renaming it to Tofu-V1_Rev0

• Using Mac’s Finder (or Windows Explorer…etc):
• Locate and select all the files
• ReName as desired… (used the ‘Rename’ feature in Finder

done!

[ADDED] I usually keep my FreeCAD files in the Kicad folder and, when moving to the Released/Final version, I copy the Project Folder and Paste it into my Finished Folder, then I Rename them, as indicated…

A Real Example (last screenshot)

After Renaming: and deleting the files of no further need
Screen Shot 2021-10-29 at 10.18.28 AM

… Please try to do that with a project with more than one schematics sheet…

Each file (pcb, schematic…etc) with same name will get appended with a number… try it yourself…

Not sure if I understand what/how you do this. Can you show it in a short youtube video, why not as short as using “save as”?

GIF video below.

You can discover (by trying out different approaches) what works best for your work style and needs. I do what works best for ‘me’ and offered my suggestion as such…

I prefer to Not let it append the name with a number so, I set the filenames with appropriate number when I create (copy) files…

Save-As acts on One file at a time…

Thanks, that’s brilliant! But it seems this possibility has been removed in 5.99 (at least on Mac). Just tried to do it, could not find it… for the sake of it, will now download 5.19 for Mac and see if it was possible even then, then install 5.19 maybe with the risk of screwing up 5.99…

… did not work, could not even mark the files in the main windows as you showed in the gif (why a gif video in the year of 2021?) so could not rename anything…

Changing file name the way I did it has Nothing to do with Kicad (so, doesn’t matter what Kicad version). It’s simply using the Computer’s File tool (Finder, on Mac) to locate, select and right-click (or menubar) and ‘Rename’.

Check your files to assess your access… It’s too simple for it to be more than just changing file name in bulk…

My 63yr old kid brother’s Windows machine: He deleted all of the files he didn’t reconginze (.dll, ini… dot everything that makes it work). Then, he wondered why the machine didn’t boot…

“Why did you delete them?”, I asked.

“Well, I didn’t create them so, I thought they were spam”

kids!

1 Like

“Why did you delete them?”, I asked.
“Well, I didn’t create them so, I thought they were spam”

Lovely!

Thanks for your help, BlackCoffee, please check out this non-success (I don’t know how to make animated gif if that is what you prefer):

https://youtu.be/Af0fMbLSr3E

No more comments/ideas here?

Check the section “Batch renaming multiple files” on this link https://appleinsider.com/articles/21/06/23/how-to-batch-rename-files-in-macos

So, first you would do a “Save As” on KiCad 5.99. Then you open your file browser and do the batch renaming of the other schematic subsheets that were not renamed automatically.

It’s not ideal as you would have to do two steps, but that’s the shortest way for your use case. For other users, it’s more suited to only rename the main files and not the subsheets. Maybe in the future, there could be a checkbox in KiCad-SaveAs so that it automatizes the rename-process depending on if you want to rename also the subsheets, based on some wildcard or suffix, or not.

Btw, related: https://gitlab.com/kicad/code/kicad/-/issues/4661

Thanks I tried that now. The result is the same as in the video I showed = the project is ruined.

As I understand your usecase, you’re looking to make a backup snapshot of the project at a certain point in time, yes?

To accomplish that, could you just copy & rename the folder, and leave the files inside alone?

I think you’re struggling to find solutions to this because this isn’t a workflow that a lot of people use. Personally I use a revision control tool for all of my projects, both personal and professional, kicad and otherwise (this is what @John_Pateman described above).

Please, do it the other way around.

  • First open the Kicad Project.
  • Click on File, SaveAs, NewName (New Folder)
  • Then, in the file browser, go to the new folder and use the batch-rename to rename the remaining subsheets.
  • Potentially you need then to update the link on the main sheet to the subsheet opening the main .sch with a text editor.

That’s what I did. Check this new video, made for you as we speak, ferdymercury: https://youtu.be/Sl6HCfq3Gr8

You are missing one last step. After batch-renaming in your file browser, do the following:

  • Select New Name.kicad_sch, click on “Open With”, and choose a plain text editor (Notepad, Geany or whatever)
  • Find & Replace all occurrences: OldName --> NewName
  • Save and exit
  • Now reopen KiCad

I tried in one of my project and it’s working.

Ok thanks, yes that works, it’s like an “illegal” way of doing it, like working like an not sophisticated pirate! I would like this simple thing to work “legal”/sophisticated, built into KiCad as it’s so basic, something that almost every other computer software has…

Yep, I kind of agree that a checkbox “Rename also schematic subsheets” (if they share the same prefix) would be helpful within the SaveAs dialog.

You can suggest it as a wishlist item here: https://gitlab.com/kicad/code/kicad/-/issues/

If there are enough people interested, it might be implemented in the post v6 future.

I have been nagging enough about this, and most guys seems to dislike the idea so I stop right here :slight_smile: Thanks for your help ferdy, now I at least know renaming is not impossible—even if it’s a bit tricky without any particular reason!

1 Like

We can only wish it would be that simple. Most computer software handles single files, for example a .doc file or .txt or .xml or .binblaah or whatever. Renaming or Save As is as simple as renaming one file and that’s it. But KiCad projects have many files and the project depends on file names. There may also be dependencies between projects as was explained above. The project name can also be referenced inside files and the project depends on that to work correctly. The project may have exported files which also may have the project name inside them. The project folder may have external files which have nothing to do with KiCad.

This all makes a simplistic “just rename all files” an impossibility. It can work for some cases, but KiCad can’t just have a feature which creates non-working projects in some other cases.

It’s also possible that the project name happens to be part of some string inside files which just happens to be similar but isn’t actually the name of the project. Therefore blind search/replace doesn’t work.

The project name is often exported to files but not in a text format. For example gerbers have usually the project name and revision in them. So, renaming/save as is incomplete in any case, and it’s questionable what has been achieved by renaming as many files as possible if the old project name is there anyway.

If it would have been as easy as renaming some files it would have been implemented years ago. Most of the end users seem to agree (me included) that Save As is a self-evident basic feature for almost all software. But what it means in KiCad isn’t actually self-evident.

So, we have a couple of options.

  1. Have a simple Save As feature which renames something but not everything possible.
  2. Have Save As which renames more thoroughly but potentially make some projects non-functional. This isn’t a real option at all.
  3. Write a more complex Save As dialog with several options: which kinds of files should be renamed, what files should be copied from the original etc. There should be a list of replaced strings which the end user can accept case by case.
2 Likes