About "Spreadsheet`s Lable in Expressions ",please help!

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
xsuper9988
Posts: 223
Joined: Sat Oct 24, 2020 4:20 am

About "Spreadsheet`s Lable in Expressions ",please help!

Post by xsuper9988 »

1.
I build spreadsheets
Then use Lable "TestABC" in the expression

2.
I modify the spreadsheet Lable "TestABC" to "TestAAA"
The expression is automatically updated to "TestAAA"

3.
I modify the variable's Lable
Spreadsheet automatically updates but not using Label "TestAAA"
this is causing trouble for me

4.
when i have a lot of spreadsheets
If the expression is not displayed in Label
that would be unreadable
And every time i modify the variable Lable, i need to modify a lot of places

Is there any way to solve
Thank you everyone
Attachments
SpreadsheetExpressions001.png
SpreadsheetExpressions001.png (78.96 KiB) Viewed 1490 times
SpreadsheetExpressions002.png
SpreadsheetExpressions002.png (78.97 KiB) Viewed 1490 times
SpreadsheetExpressions003.png
SpreadsheetExpressions003.png (80.46 KiB) Viewed 1490 times
SpreadsheetExpressions004.png
SpreadsheetExpressions004.png (189.36 KiB) Viewed 1490 times
SpreadsheetExpressions.FCStd
(9.66 KiB) Downloaded 19 times
User avatar
adrianinsaval
Veteran
Posts: 5553
Joined: Thu Apr 05, 2018 5:15 pm

Re: About "Spreadsheet`s Lable in Expressions ",please help!

Post by adrianinsaval »

that is indeed annoying, anyone knows where in code this is handled?
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: About "Spreadsheet`s Lable in Expressions ",please help!

Post by TheMarkster »

Here is a workaround. Instead of creating the spreadsheet in the spreadsheet workbench, create it in the python console and give it your label name as a name.

Code: Select all

App.ActiveDocument.addObject("Spreadsheet::Sheet", "TestABC")
Or you can make a macro that asks for the name:

Code: Select all

from PySide import QtGui
name, ok = QtGui.QInputDialog.getText(Gui.getMainWindow(), "New Sheet", "Enter sheet name:")
if ok:
    App.ActiveDocument.addObject("Spreadsheet::Sheet", name)

User avatar
xsuper9988
Posts: 223
Joined: Sat Oct 24, 2020 4:20 am

Re: About "Spreadsheet`s Lable in Expressions ",please help!

Post by xsuper9988 »

TheMarkster wrote: Wed Jan 12, 2022 5:19 pm Here is a workaround. Instead of creating the spreadsheet in the spreadsheet workbench, create it in the python console and give it your label name as a name.

Code: Select all

App.ActiveDocument.addObject("Spreadsheet::Sheet", "TestABC")
Or you can make a macro that asks for the name:

Code: Select all

from PySide import QtGui
name, ok = QtGui.QInputDialog.getText(Gui.getMainWindow(), "New Sheet", "Enter sheet name:")
if ok:
    App.ActiveDocument.addObject("Spreadsheet::Sheet", name)

Still the same problem
When the variable is redefined
Expressions are not using Label
Spreadsheet file name cannot be changed
When the file name is repeated
File name cannot be edited
Is there a solution to change the filename?

Still thank you very much

May I ask you another question?
Except for spreadsheets
Are there other solutions for global variables?
Attachments
TEST001.png
TEST001.png (95.89 KiB) Viewed 1300 times
TEST002.png
TEST002.png (88.63 KiB) Viewed 1300 times
User avatar
thomas-neemann
Veteran
Posts: 11964
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: About "Spreadsheet`s Lable in Expressions ",please help!

Post by thomas-neemann »

xsuper9988 wrote: Wed Jan 12, 2022 6:50 am ....
Is there any way to solve
..

I would only use 1 table as a workaround
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
xsuper9988
Posts: 223
Joined: Sat Oct 24, 2020 4:20 am

Re: About "Spreadsheet`s Lable in Expressions ",please help!

Post by xsuper9988 »

thomas-neemann wrote: Thu Jan 13, 2022 7:29 am
xsuper9988 wrote: Wed Jan 12, 2022 6:50 am ....
Is there any way to solve
..

I would only use 1 table as a workaround
Because I use a lot of parameters
Need to use more spreadsheets
This reduces recalculation time
It is also more convenient for classification management
Attachments
SpreadsheetExpressions010.png
SpreadsheetExpressions010.png (122.74 KiB) Viewed 1206 times
User avatar
thomas-neemann
Veteran
Posts: 11964
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: About "Spreadsheet`s Lable in Expressions ",please help!

Post by thomas-neemann »

xsuper9988 wrote: Thu Jan 13, 2022 10:01 am ..
This reduces recalculation time
...
ok, does it make sense to split such an assembly into several files?
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
xsuper9988
Posts: 223
Joined: Sat Oct 24, 2020 4:20 am

Re: About "Spreadsheet`s Lable in Expressions ",please help!

Post by xsuper9988 »

thomas-neemann wrote: Thu Jan 13, 2022 10:03 am
xsuper9988 wrote: Thu Jan 13, 2022 10:01 am ..
This reduces recalculation time
...
ok, does it make sense to split such an assembly into several files?
"One Part" with "One Spreadsheet"
Easy to copy the entire Part
Then modify the parameters

Of course here the spreadsheet is used instead of the global variable
It would be better if there were other solutions with global variables
Because the spreadsheet has a little Lag
User avatar
adrianinsaval
Veteran
Posts: 5553
Joined: Thu Apr 05, 2018 5:15 pm

Re: About "Spreadsheet`s Lable in Expressions ",please help!

Post by adrianinsaval »

User avatar
xsuper9988
Posts: 223
Joined: Sat Oct 24, 2020 4:20 am

Re: About "Spreadsheet`s Lable in Expressions ",please help!

Post by xsuper9988 »

adrianinsaval wrote: Thu Jan 13, 2022 12:53 pm There's DynamicData_Workbench
I have tested "DynamicData_Workbench"
But I forgot why I stopped using it
I will download and test again
Discuss when I test again
Post Reply