Discussion about the development of the Assembly workbench.
Hello everyone, I'm doing some asemblies with the Assembly 4 workbench and the file itself works fine. However, when I change the location of the file, all the links become missing. Is there a way to keep that info? I would like to be able to share the assembly via GitHub so other people can see and use the file.
can you be more precise in what you're doing (or want to do) ?
A link (App::Link) is like a shortcut or symbolic link to a specified file, it stores the path to the target file. Therefore, if you change the file location then you loose the link to it. Normally, path in App::Link are relative, meaning that if you move both files – the assembly containing the link and the target file – then the assembly should be able to find the dependent part.
Sorry for the late answer. I was expecting a notification from the thread but I didn't check the option...
The assemblies work fine on my computer (when I dont move them). However, its true that sometimes when I duplicate an asembly and move the copy to another location, the links keep working, But it seems this only works if the original file is open during the process. That's why I'm not sure if someone downloads the files from GitHub will be able to open the files without missing links.
When I have FreeCAD closed and I relocate the location of some of the assemblies, the links break. When this happens I use the Python console to set the linkedObjects in the assembly by sending each part to the console (atm it is the only solution I found)
If you copy/move the assembly without moving also the linked parts, then it's normal that the assembly looses the links. Did you try to move the assembly file AND all other part files that are linked in the assembly ? An assembly uses relative path to store the location of the linked parts, so the best way is to move/copy the entire directory of your project.
if you select "insert link" on a broken link, it will give you the option to re-assign the linked object.When this happens I use the Python console to set the linkedObjects in the assembly by sending each part to the console (atm it is the only solution I found)
The problem is that most of the parts are used in other assemblies, so I have a folder for "3d printed", another one for "metal sheets" and another with "Standard componets" as bolts, bearings, aluminum profiles, etc. That way I dont have duplicated files along the project.
I imagine, for what you said, that the best way is to have all the used elements in the same folder of the assembly if I want to share the assembly with other people. Am I right?
what you can try is to have a symlink "Library" (or PartsLibrary or whatever you fancy) in the assembly directory, which points to the directory where you store your standard parts. That way you can access them through "Library/3Dprinted" and "Library/MetalSheets" ... then, all the people with whom you share the assembly need to have this symlink which points to where THEY store THEIR standard partsOpenR wrote: ↑Tue Jun 14, 2022 9:05 pm The problem is that most of the parts are used in other assemblies, so I have a folder for "3d printed", another one for "metal sheets" and another with "Standard componets" as bolts, bearings, aluminum profiles, etc. That way I dont have duplicated files along the project.
But if you have your standard shared parts all over your hard drive, then it's going to be difficult.
Thank you very much for all the useful info!
Well, all the used parts are contained in a folder with a buch of sub folders. This is the repo so you can have an example of the distribution: https://github.com/TheOpenR/Open-Printer/tree/main/CAD
Might be possible to add a feature to look for the missing files (links) recursively on a given _PATH_, as NX has?
- Screenshot_20220709_200248.png (36.86 KiB) Viewed 376 times
yes, that would be great, we had talked about such things before, but this is core FreeCAD::Link functionality, nothing I can do about. Today, App::Link stores the files as relative path.
But you could make the suggestion, probably in the Open Discussion forum. Ideally, I'd like to be able to choose between relative path, absolute path, and user-configurable search path.