Using a master spreadsheet in the top level assembly file

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!
User avatar
Aleks
Posts: 309
Joined: Sun Mar 08, 2020 5:27 pm
Location: Bonn, Germany
Contact:

Using a master spreadsheet in the top level assembly file

Post by Aleks »

I want to create an assembly (a2plus) that contains parts which automatically update, depending on the spreadsheet parameters in the top level assembly file.
I am able to reference the spreadsheet cell value in the top-level-assembly file from the spreadsheet in the component part, but all the expressions fail to update.

Does anybody know how to solve the update problem?



freecad-dynamic-assembly.png
freecad-dynamic-assembly.png (7.53 KiB) Viewed 2453 times
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
User avatar
Aleks
Posts: 309
Joined: Sun Mar 08, 2020 5:27 pm
Location: Bonn, Germany
Contact:

Re: Using a master spreadsheet in the top level assembly file

Post by Aleks »

Maybe my explanation was too vague and complex. So here is a more specific question:

I have got this a2plus assembly:
schraubstock.png
schraubstock.png (198.75 KiB) Viewed 2337 times
The assembly consists of one file for the whole assembly and multiple files for the individual parts.

I want to be able to set the three parameters ("spannhoehe", "spannbreite", "max_spannweite") in the assembly file.

All components of that assembly should update, according to the parameters set.

Has anyone done something like this in FreeCAD?
I tried using cross-document-linking with spreadsheets but had no luck with that, because some or all expressions would not update.

This is how I created the link:

Code: Select all

assembly#<<Spreadsheet>>.spannhoehe
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
User avatar
M4x
Veteran
Posts: 1472
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Using a master spreadsheet in the top level assembly file

Post by M4x »

I've used linked spreadsheets in different files with components and in assembly3 files too. I haven't done exactly what you've described but I think that should work too. Should I setup a minimal example?
User avatar
Aleks
Posts: 309
Joined: Sun Mar 08, 2020 5:27 pm
Location: Bonn, Germany
Contact:

Re: Using a master spreadsheet in the top level assembly file

Post by Aleks »

I would be grateful if you could help.

The strange thing is, that very rarely it works, but most of the time it doesnt. Maybe you are able to find out what the problem is.
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
User avatar
czinehuba
Posts: 159
Joined: Mon Oct 15, 2018 4:59 am
Location: UK
Contact:

Re: Using a master spreadsheet in the top level assembly file

Post by czinehuba »

Haven't tried it myself. But was meaning too. Create a part with a spreadsheet, and link it to assembly and other files.

Maybe
heron
Posts: 307
Joined: Mon Apr 20, 2020 5:32 pm

Re: Using a master spreadsheet in the top level assembly file

Post by heron »

Aleks wrote: Tue Oct 12, 2021 5:53 pm I am able to reference the spreadsheet cell value in the top-level-assembly file from the spreadsheet in the component part, but all the expressions fail to update.
I don´t sure but I think that this will raise a cyclic depency issue.

I would insert the master spreadsheet in a different file. In this way both the parts and the top level assembly are able reference the spreadsheet cells values in the master spreadsheet file without cyclic depency issues. With the minor inconvenience of having to stay open this file as well to modify parameters.

I don´t test that with A2Plus, I tested it with Assembly4 and works fine.

I hope this helps,
Cheers.
User avatar
Aleks
Posts: 309
Joined: Sun Mar 08, 2020 5:27 pm
Location: Bonn, Germany
Contact:

Re: Using a master spreadsheet in the top level assembly file

Post by Aleks »

czinehuba wrote: Fri Oct 15, 2021 11:56 am Haven't tried it myself. But was meaning too. Create a part with a spreadsheet, and link it to assembly and other files.

Maybe
Thats exactly what I did, but got the update problem.
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
User avatar
Aleks
Posts: 309
Joined: Sun Mar 08, 2020 5:27 pm
Location: Bonn, Germany
Contact:

Re: Using a master spreadsheet in the top level assembly file

Post by Aleks »

heron wrote: Fri Oct 15, 2021 2:30 pm I don´t sure but I think that this will raise a cyclic depency issue.
Thats also my best bet.

I will try putting the spreadsheet in a different file.
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
User avatar
M4x
Veteran
Posts: 1472
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Using a master spreadsheet in the top level assembly file

Post by M4x »

Aleks wrote: Thu Oct 14, 2021 10:27 pm I would be grateful if you could help.
Here is my example (place files in the same folder). Spreadsheet in the top level assembly file drives components in a separate file. Is this what you'd like to achieve?

object tree
object tree
Snip macro screenshot-af829c.png (18.2 KiB) Viewed 2027 times

Spreadsheet
Spreadsheet
Snip macro screenshot-da67b9.png (10.49 KiB) Viewed 2027 times

assembly
assembly
Snip macro screenshot-731afd.png (4.25 KiB) Viewed 2027 times

Code: Select all

OS: Ubuntu 20.04.3 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.25943 (Git) AppImage
Build type: Release
Branch: master
Hash: a65464b722a846bd2999aa2fecdff1132b15b297
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)
Attachments
Example_Asm_Spreadsheet_components.FCStd
(18.47 KiB) Downloaded 54 times
Example_Asm_Spreadsheet_assembly.FCStd
(25 KiB) Downloaded 53 times
User avatar
Aleks
Posts: 309
Joined: Sun Mar 08, 2020 5:27 pm
Location: Bonn, Germany
Contact:

Re: Using a master spreadsheet in the top level assembly file

Post by Aleks »

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. Is this what you'd like to achieve?
You are correct, thats what I want to do.

I have tried it out again with a fresh mind and it works fine now. I couldnt tell you what the problem was, but I will keep an eye on that in the future.

I would mark this problem as not reproducable right now. If someone experiences something similar, it can be commented here.
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
Post Reply