Rename Project with included files

It’s hard to help if you can’t explain what’s wrong…

1 Like

Why? If Save As doesn’t really save with the new name given by you, it’s a bug, and we want to know under what circumstances it happens. If it works for others doesn’t mean it works for all cases if there really is a bug.

EDIT: here’s one result of renaming. I had a project named “test”, I used Save As and added the date to the name. It doesn’t rename everything, but at least the important files.

image

image

I have tried to explain with words here. If you want, even if videos is not popular here, I can try to show you what happens in this case… btw, also the “Project Files” library tree in KiCad is a mess without a meaning. Why all this over-information with all these files/folders/databases?

Videos aren’t more popular here only because people don’t create them. I favor them for many purposes because they tell exactly what is done and what happens. Please attach a screencast.

Another option is a zipped archive. With one command you can copy multiple files or all the files in one subdirectory into one archive file and compress it into a “zipped”, or compressed file. It has been 29 years since I worked using a Mac, and then only for a few weeks. Look into whether there might be a utility for making a zipped archive of files in the Mac world. (In linux some of these utilities are called tar, bzip2, and gunzip.)

Ok, here we go, and again, I only ask for simplicity here for basic functions. I not ask for scripts or Linux code.

https://youtu.be/7h1W2DmWo1c

Videos can be very helpful if they’re short, to the point, and have context about what is going on, what is expected, and what is unexpected. Lots of things are hard to precisely explain in words but easy to demonstrate in video.

If they don’t have the context, then it can be hard to figure out what the video is intending to demonstrate :frowning:

Ah, your issue is that you’re doing a “Save Copy As” from either the board editor or the schematic editor. This only makes a copy of the PCB or the schematic, respectively.

Instead, if you want to make a copy of the project and have all the links work correctly, is to go to the main Kicad window (the project window) and do a File -> Save As. That will rename all of the relevant files and keep everything linked.

Keep in mind that in Kicad the project, root schematic, and pcb all need to have the same name in order to be linked together.

EDIT: I’m sorry, I didn’t watch long enough.

The behavior you see is what I would expect. The files I enumerated above are renamed properly, including the root schematic. The schematic sub-sheets are not renamed.

What is happening when you rename a project is that the project name is changed. The project name is used by the project file, the schematic root sheet, the pcb files, and the other files I listed above. These files are all renamed to your new project name.

In the general case, the schematic sub-sheets are not named the same as the project, so Kicad cannot know what you want to rename them to. Your case is a bit peculiar because you have the timestamp in the filename for all of your files, and you want Kicad to understand that you want to update that in all of your files. That’s not true in general and it would be dangerous for Kicad to make any assumptions there.

For comparison, here’s one of my projects I’m working on right now:
image

The project is preamp-2021. If I wanted to save it as preamp-2022, I would want the root sheet (preamp-2021.kicad_sch) to become preamp-2022.kicad_sch, but I wouldn’t want to change any of the sub-sheets headphone_amp.kicad_sch, power_supply.kicad_sch, or volume_control.kicad_sch. What would kicad automatically rename them to…?

Thanks, the point seems to be missed here so I better stop the discussion from my point of view and remove the video now. I will wait and see what will happen with KiCad and the coming 6.x and or 7.x release, so far it’s a bit too much strange things going on…

Actually I understand where you are coming from. In document writers say like Libreoffice, you can Save As to make a new copy of the document. Libreoffice has the advantage that the document is a single file, but a project in KiCad comprises several files, related only by the basename. So ideally there should be a project-wide Save As to make a clone of the entire project (but you have to take all child sheets just in case they are used). A complication is that often you want a different directory too although it will not hurt to use the existing directory.

Currently I do this in the CLI by cloning the entire directory to a new location and then changing the basename. I await seeing what the v6 Save As will do.

“Currently I do this in the CLI by…”

What is “CLI”?

CLI = Command Line Interface, in this context it’s probably a command line shell in a terminal window. Shell isn’t an oil company and terminal isn’t deadly… :slight_smile:

Okay thanks, now let’s get back to Eagle here :slight_smile:

V6 and V7 won’t change this: schematic subsheets are not tied to one specific project, so they should not be automatically renamed when you rename the project. You can reference these subsheets from multiple places, so renaming them just because you rename the project would potentially break other projects.

1 Like

However, the Save As feature copies the whole project to another location. Other existing project won’t and can’t refer to that anyway unless the other projects are edited explicitly.

I don’t mean KiCad necessarily should rename subsheet files, especially if they don’t have the project name in their file names. This whole feature is full of design decisions, what to rename and what not. The current behavior is a compromise. I have already asked for a minimal Save As which would copy and rename only the core project files without any extra files or output files.

1 Like

…or unless some of the subsheets were already links rather than real files.

I think it’s pretty clear: rename input (source) files that are named according to the project; don’t rename anything else.

3 Likes

So just to be clear, “save as” is only available for a whole project in 5.99, not in the current version 5.1.10? I know in 5.1.10 you can “save as” a schematic or pcb file.

Yes, that’s right. Save As for whole project is a new feature. That’s why I tried to find out what TheSwede actually wanted, because it’s certainly possible there’s a bug which hasn’t been noticed.

1 Like

Zip is built into current versions of macOS. Right click on any file or folder and select “Compress filename” in the context menu. It will create a zip archive filename.zip

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

1 Like