[Solved] Feature #3271: Relative file references give Document not found unless that file is opened first

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
Kunda1
Posts: 7676
Joined: Thu Jan 05, 2017 9:03 pm

[Solved] Feature #3271: Relative file references give Document not found unless that file is opened first

Postby Kunda1 » Sat Dec 09, 2017 12:19 pm

issue #3271: Relative file references give Document not found unless that file is opened first
Description
Apparently, spreadsheets have to be opened before they can be used. Not sure if it is due to their being relative file paths, but it should not matter. If I reference an alias in a spreadsheet from the value of a constraint in a sketch, the application should know how to read that alias value and use it, and not say "document not found".

A full GIF of the error is shown in the attached screencapture-gif-0012.gif file see issue #3271 (also includes another issue with failing to parse an error). See issue #3272

Steps To Reproduce
Extract the tarball.
cd into the directory that is extracted so that the current working directory can resolve paths to other files in the set of files.
Open up the file: freecad-daily UpsideDownMonitorMount.fcstd
Open up the Leg.fcstd file using the button.
Double click on the sketcher
Double click on the constraint with 1.5yd ("Shelf Depth")
Click on the fx button.
Type in a reference to the alias that is in the spreadsheet: MasterSpreadsheet#Spreadsheet.Sd
Notice it says Result: Document not found: MasterSpreadsheet
That is incorrect. It should be found as it resides in the current working directory from which I invoked. Even if it was a fully-qualified/absolute file path, it should still resolve the spreadsheet, and not require me to open it.

OS: Ubuntu 17.04
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12643 (Git)
Build type: None
Branch: master
Hash: 868d9cc6c215ce3a2ab20d454378ec00e1b9ed26
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
Last edited by Kunda1 on Sun Mar 22, 2020 5:21 pm, edited 2 times in total.
Reason: marked thread as [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
DeepSOIC
Posts: 7658
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Bug #3271: Relative file references give Document not found unless that file is opened first

Postby DeepSOIC » Sat Dec 09, 2017 12:40 pm

a) the bug has nothing to do about Sketcher. It's FreeCAD itself.
b) I don't think it's a bug. But the documentation is not clear about it. It says:
Of course, it's up to you to load the corresponding documents later when you want to change anything.
At this point, FreeCAD can't fetch a value from a project file, AFAIK. It has to be open in same FC session.

I would consider this a feature request rather than a bug.
adrianinsaval
Posts: 343
Joined: Thu Apr 05, 2018 5:15 pm

Re: Feature #3271: Relative file references give Document not found unless that file is opened first

Postby adrianinsaval » Sat Mar 14, 2020 2:33 am

realthunder wrote: With this commit in upstream, the expression (PropertyExpressionEngine/PropertySheet to be exactly) gained the ability to automatically load the linked external document. For existing document authored in previous version of FreeCAD, manually load all the files in newer version FreeCAD, and save all of them to enable auto loading.
Shouldn't this ticket be closed? And maybe issue #3272 too? Not sure...
User avatar
Kunda1
Posts: 7676
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Solved] Feature #3271: Relative file references give Document not found unless that file is opened first

Postby Kunda1 » Sun Mar 22, 2020 5:21 pm

realthunder wrote: With this commit in upstream, the expression (PropertyExpressionEngine/PropertySheet to be exactly) gained the ability to automatically load the linked external document. For existing document authored in previous version of FreeCAD, manually load all the files in newer version FreeCAD, and save all of them to enable auto loading.
The referred to commit is git commit 93e60caa35ce793. I'll close issue #3271 and mark this thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features