Assembly4: XLink absolute filepath problem

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
aapo
Posts: 615
Joined: Mon Oct 29, 2018 6:41 pm

Re: Assembly4: XLink absolute filepath problem

Post by aapo »

realthunder wrote: Fri Nov 08, 2019 12:09 am It got stuck in one of my feature branch. I have just split it out and submitted the PR here.
After this patch will be applied, will it be possible to load old Assembly4 files containing absolute filepaths; or will there be a need to convert the files somehow?

Reading the code in the patch leads me to think, that if it's possible to read an old FCStd file, then saving the file with the patch enabed should make the xlink paths relative. Thus, I'd think that a simple load and save would make any Assembly4 files "good", but is this true?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly4: XLink absolute filepath problem

Post by realthunder »

aapo wrote: Fri Nov 08, 2019 8:07 am
realthunder wrote: Fri Nov 08, 2019 12:09 am It got stuck in one of my feature branch. I have just split it out and submitted the PR here.
After this patch will be applied, will it be possible to load old Assembly4 files containing absolute filepaths; or will there be a need to convert the files somehow?

Reading the code in the patch leads me to think, that if it's possible to read an old FCStd file, then saving the file with the patch enabed should make the xlink paths relative. Thus, I'd think that a simple load and save would make any Assembly4 files "good", but is this true?
Yes, just load and save. You may need to manually save all the linked documents, because they are not marked as changed. Just set each document as active, and save.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
FCuser2019
Posts: 125
Joined: Fri Sep 13, 2019 12:15 pm

Re: Assembly4: XLink absolute filepath problem

Post by FCuser2019 »

realthunder wrote: Fri Nov 08, 2019 12:09 am
adrianinsaval wrote: Thu Nov 07, 2019 9:51 pm Sorry to bother you but are there any news on this front?
It got stuck in one of my feature branch. I have just split it out and submitted the PR here.
Thanks for this fix, FreeCAD_0.19-18714 works :)
project4
Posts: 237
Joined: Fri Jul 12, 2013 12:53 pm

Re: Assembly4: XLink absolute filepath problem

Post by project4 »

Hi guys,

I'm facing exactly the same problem with asm4.
I'm with 0.19 pre-release daily build, so I guess the realthunder's fix should be in.
Is there anything I should check to make sure I have that fix?

My physical path include symbolic links and on some PCs also a NFS mount, that's probably that cause the problem along the way.

Will appreciate a fix or workaround for that problem.
Thanks.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly4: XLink absolute filepath problem

Post by Zolko »

project4 wrote: Tue Aug 25, 2020 7:46 pm I'm with 0.19 pre-release daily build, so I guess the realthunder's fix should be in.
could you please try with the AppImage:

https://github.com/FreeCAD/FreeCAD/rele ... g/0.19_pre
try the Assembly4 workbench for FreCAD — tutorials here and here
project4
Posts: 237
Joined: Fri Jul 12, 2013 12:53 pm

Re: Assembly4: XLink absolute filepath problem

Post by project4 »

Running from the latest AppImage gave the same results :(

More information here:
https://github.com/Zolko-123/FreeCAD_As ... /issues/95
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly4: XLink absolute filepath problem

Post by realthunder »

project4 wrote: Wed Aug 26, 2020 6:39 am Running from the latest AppImage gave the same results :(

More information here:
https://github.com/Zolko-123/FreeCAD_As ... /issues/95
PR submitted here for the fix.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly4: XLink absolute filepath problem

Post by Zolko »

realthunder wrote: Wed Aug 26, 2020 8:33 am PR submitted here for the fix.
hold-on, this doesn't look right:

Code: Select all

We used to rely on QFileInfo::canonicalFilePath() to resolve it,
but has now been changed to simply use the absoluteFilePath()
We had absolute file paths before and that wasn't good either. Why not use filePath() ?

https://doc.qt.io/qt-5/qfileinfo.html
try the Assembly4 workbench for FreCAD — tutorials here and here
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly4: XLink absolute filepath problem

Post by realthunder »

Zolko wrote: Wed Aug 26, 2020 8:49 am We had absolute file paths before and that wasn't good either. Why not use filePath() ?

https://doc.qt.io/qt-5/qfileinfo.html
The absolute path is not used for saving, it is used as a key to lookup already loaded document. Just compare the documentation of QFileInfo::canonicalFilePath() and absoluteFilePath(), you'll know the difference.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly4: XLink absolute filepath problem

Post by Zolko »

realthunder wrote: Wed Aug 26, 2020 8:52 am The absolute path is not used for saving, it is used as a key to lookup already loaded document.
Ah OK, thanks.

And what happens if we load the same document through different symlink-path into the assembly ?
try the Assembly4 workbench for FreCAD — tutorials here and here
Post Reply