New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List and Export linked files #370
Conversation
I tried to load the changes but no icons are loaded in the WB, there is something in |
Thanks. It happens that Freecad has a different file path for the file being loaded when using the GUI and the CLI. I improved the behavior of the zip exporter. Now, I don't have issues with InitGui.py |
Is anytree, I have it in my system but not in FreeCAD's enviroment |
Did you do/try this? sudo -H pip install anytree |
I installed it this way and it was working. |
Ok, I solved it copying the The icon of I got some errors with
|
I have just tried this and did not work in both snap and AppImage |
hm, I thought those "UserWarning: Duplicate name:" were just a warning, this may not be the case. They have to be added to preserve the hierarchy when unpacking the zip. I could rename all items before inserting in the package, and then I did not have errors, but this is not the fix since they won't be renamed back to the original when unpacking the zip. I am investigating this thing. |
try to extract it and load the main assembly, please. |
For some reason in the list the googley eyes, Spacer 6.35 and V slot profile 370 mm are not detected and the files are not saved in the zip. The assembly in the zip file is almost complete but due to above error there are errors about file not found |
It seems there is no duplicated files, only in the zip Examining this case here: 17:54:17 ASM4> [ZIP] Adding file: cad/Steel L-Bracket for NEMA 17.FCStd
17:54:17 /tmp/.mount_FreeCARwPJVr/usr/lib/python3.10/zipfile.py:1517: UserWarning: Duplicate name: 'cad/Steel L-Bracket for NEMA 17.FCStd' Then we see that there is only one file with this name: ➜ diy-pcb-cnc git:(testing) ✗ find -name "*Steel L-Bracket for NEMA 17.FCStd*"
./cad/Steel L-Bracket for NEMA 17.FCStd This is the whole list of files.
|
Ah, the list of files I was using did not have unique files. It is fixed now. |
These files are not being restored
But they exist ➜ diy-pcb-cnc git:(testing) ✗ find -name Googly_eyes.FCStd
./cad/Googly_eyes.FCStd
➜ diy-pcb-cnc git:(testing) ✗ find -name 2020x370_V_slot_profile.FCStd
./cad/FreeCAD-library/2020_V-slot_Al_extrusion/2020x370_V_slot_profile.FCStd
➜ diy-pcb-cnc git:(testing) ✗ find -name Spacer_6.35.FCStd
./cad/Spacer_6.35.FCStd Maybe my parser is not finding them. |
Yeah, they are not in the above list with 57 items. |
The |
Those files had the Element Count property used. |
ah, the file is missing, please, check if it was added to the repo. |
It is in the repo but it's not in the zip file |
yeah, I was looking the wrong file, sorry |
@hasecilu took some time but now it exports all files of the main assembly. An example of that would be Bed_top.FCStd where most of the files come from outside |
Cool, it's working!
I'm not sure if there are file location guidelines for (sub) assemblies, moving |
I was thinking that I could export the parent folder that has both assembly and its parts. So if the assembly and related files are like this:
Then it would normalize paths, considering the folder that has both (all) the parts. Also, some things to do
|
Hey, @hasecilu now it exports assemblies with files in other folders. So it works with the Bed_top.FCSd the way I was thinking before. And the elegant thing would be to add a symlink to the exported assembly inside the root folder when the main assembly is not in the root folder. I will implement this tomorrow. |
Tested and working!
Sounds nice, could be useful when a assembly is made of many subassemblies and you need to find the main one. |
I've shared this finding here, let's see how your peers are going to react. |
I've pushed the code since it is harmless to the export process. |
Ah, yes. This is the issue I am talking about. |
So the symlink is being created correctly. However, Freecad cannot open it fine, when it has Linked parts. Unless you are talking about a different problem. |
Now the user can select where the zip is exported and how to name it. |
It's the same issue. It looks like there is no differentiation between the files:
|
This is an attempt to list unique linked files of the assembly.
I also export files into a zip package with the name of the file +
asm4_zip
in the assembly folder.