Cannot reference to expressions in external spreadsheet

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
schloeri
Posts: 38
Joined: Wed Apr 20, 2016 5:48 pm

Cannot reference to expressions in external spreadsheet

Post by schloeri »

Good afternoon,

I have designed a body stored in a FreeCAD file. I also do have a different FreeCAD file (master.FCStd) in the same directory just containing a spreadsheet. This spreadsheet does hold all relevant distances. All cells carry an alias name.

Now, these aliases are not accessible from the body file. I do know how to address those expressions as I have already done that in the past (master#name_of_spreadsheet.expression).

Here comes the difference: The file with the body originally contained several bodies together with all their sketches and modeling tools. For reorganizing the project I put every body in its individual file by copying the multi part file and deleting all but one body in each file. At the same time I renamed all entries in the model tree to be "Sketch", "Pad", "Pocket" etc rather than "Sketch001", "Pad001", etc.
Now when I try to insert the external expression (no matter which from the spreadsheet) the formula editor says "Document object not found: Sketch002". There is no Sketch002 for the body, however, there was a Sketch002 in the multi body file.

Any idea of how to get rid of that for the files and if this should be considered a bug?

Best regards

Stefan
Attachments
failure_external-expression.png
failure_external-expression.png (28.27 KiB) Viewed 2265 times
chrisb
Veteran
Posts: 54195
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot reference to expressions in external spreadsheet

Post by chrisb »

Can you upload the files (Master plus one of the others? And note, that renaming is rather relabeling. You can never change the internal name, only the displayed label.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
schloeri
Posts: 38
Joined: Wed Apr 20, 2016 5:48 pm

Re: Cannot reference to expressions in external spreadsheet

Post by schloeri »

Thanks for the feedback.

I realized the internal names in the status line when hovering over the items but even changing the labels back does not repair the file.

Attached two files
Attachments
seitenwand_lang.FCStd
(18.94 KiB) Downloaded 90 times
master.FCStd
(1.59 KiB) Downloaded 73 times
chrisb
Veteran
Posts: 54195
Joined: Tue Mar 17, 2015 9:14 am

Re: Cannot reference to expressions in external spreadsheet

Post by chrisb »

The problem is the name of the spreadsheet. The dash is inside of an expression interpreted as a minus sign. Rename the spreadsheet e.g. to daten_wc_schrank and you can reference things such as master#daten_wc_schrank.hoehe_schrank in the file seitenwand_lang.FCStd.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
schloeri
Posts: 38
Joined: Wed Apr 20, 2016 5:48 pm

Re: Cannot reference to expressions in external spreadsheet

Post by schloeri »

Hey chrisb,

thanks for looking into that. That did the trick.

Best regards
Arturok
Posts: 4
Joined: Fri Jun 15, 2018 4:14 am
Location: Mexico, Latin America
Contact:

Re: Cannot reference to expressions in external spreadsheet

Post by Arturok »

:o :) :) you are the masters, problem solved :) thanks
User avatar
Aleks
Posts: 309
Joined: Sun Mar 08, 2020 5:27 pm
Location: Bonn, Germany
Contact:

Re: Cannot reference to expressions in external spreadsheet

Post by Aleks »

I will also add, that it does not work with capital letters in the filename.
Last edited by Aleks on Mon Oct 18, 2021 11:11 pm, edited 1 time in total.
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
User avatar
M4x
Veteran
Posts: 1480
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Cannot reference to expressions in external spreadsheet

Post by M4x »

I recommend using links to make your documents easier to maintain. Here is an example of how that could look like:
M4x wrote: Fri Oct 15, 2021 8:54 pm
Here is my example (place files in the same folder). Spreadsheet in the top level assembly file drives components in a separate file.
https://forum.freecadweb.org/viewtopic. ... 60#p540257
Post Reply