Spreadsheet delete value possible bug

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!
AndrewCSP
Posts: 20
Joined: Sun Jun 02, 2019 8:02 pm

Spreadsheet delete value possible bug

Postby AndrewCSP » Fri Nov 13, 2020 11:37 am

I like to parameterise my models and create some values in a spreadsheet first. That works well.
However, editing the spreadsheet has been troublesome, and I have a reproducible problem.
If I create a row in a spreadsheet and give the value an alias, say 'wireDia', then delete that row and create another row elsewhere, I cannot now use that deleted name in the new row.
Worse still, if I access values in the model, wireDia is still listed as a value and can be used in the model, preserving its (unchangeable) last value.

OS: macOS 10.15
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16146 (Git)
Build type: Release
Branch: (HEAD detached at 0.18.4)
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
openBrain
Posts: 5209
Joined: Fri Nov 09, 2018 5:38 pm

Re: Spreadsheet delete value possible bug

Postby openBrain » Fri Nov 13, 2020 12:26 pm

Confirmed. Worth a ticket IMO.
@AndrewCSP : notice that bugs are normally discussed in "Help on using FreeCAD" subforum. ;)
---
OS: Ubuntu 18.04.5 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22894
Build type: Release
Branch: master
Hash: 9eb080488d970d313c538473e7272117ea0a7cd1
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
AndrewCSP
Posts: 20
Joined: Sun Jun 02, 2019 8:02 pm

Re: Spreadsheet delete value possible bug

Postby AndrewCSP » Fri Nov 13, 2020 12:49 pm

Thanks @openBrain. I was annoyed about not being able to re-enter the value in the spreadsheet.
What was even worse was that I had built my model using the defunct value. There seems no way to globally replace one value object in a model with another, or even to search for it, so I had to know where I had used that defunct value and manually edit.
I'm not sure of the sequence of events in my modelling, and if I would have been allowed to delete the row value if it was already in use in my model (which could have flagged the issue and offered a global update).
Do I have to eventually (when more have confirmed) raise the the bug report or will someone with more authority pick it up?
AndrewCSP
Posts: 20
Joined: Sun Jun 02, 2019 8:02 pm

Re: Spreadsheet delete value possible bug

Postby AndrewCSP » Fri Nov 13, 2020 1:03 pm

Thinking back, I remember that I wanted to move that row in the spreadsheet, and couldn't drag and drop to a different position, so I tried cut and paste. The cut worked, but the paste was then prevented, and I had to use a different label in the new position.
That could mean a larger implication for the way the whole issue is coded.
openBrain
Posts: 5209
Joined: Fri Nov 09, 2018 5:38 pm

Re: Spreadsheet delete value possible bug

Postby openBrain » Fri Nov 13, 2020 1:31 pm

AndrewCSP wrote:
Fri Nov 13, 2020 12:49 pm
What was even worse was that I had built my model using the defunct value. There seems no way to globally replace one value object in a model with another,
Indeed, but it could be quite easily implemented through a macro
or even to search for it, so I had to know where I had used that defunct value and manually edit.
The Std_DependencyGraph can show you places where a named value is used
I'm not sure of the sequence of events in my modelling, and if I would have been allowed to delete the row value if it was already in use in my model (which could have flagged the issue and offered a global update).
Do I have to eventually (when more have confirmed) raise the the bug report or will someone with more authority pick it up?
It's OK to fill in a ticket. No doubt there is a bug.
AndrewCSP wrote:
Fri Nov 13, 2020 1:03 pm
Thinking back, I remember that I wanted to move that row in the spreadsheet, and couldn't drag and drop to a different position, so I tried cut and paste. The cut worked, but the paste was then prevented, and I had to use a different label in the new position.
That could mean a larger implication for the way the whole issue is coded.
I had no bug using cut+paste. Just some limitations (such as not selecting multiple cells when copying). I propose to focus the ticket on the actual bug you described in the OP.
AndrewCSP
Posts: 20
Joined: Sun Jun 02, 2019 8:02 pm

Re: Spreadsheet delete value possible bug

Postby AndrewCSP » Fri Nov 13, 2020 1:55 pm

The bug reporting system says in large caps
IMPORTANT: POST ONLY 0.19dev BUG REPORTS
but I am still using 0.18.
Should I ignore that headline?
openBrain
Posts: 5209
Joined: Fri Nov 09, 2018 5:38 pm

Re: Spreadsheet delete value possible bug

Postby openBrain » Fri Nov 13, 2020 2:11 pm

AndrewCSP wrote:
Fri Nov 13, 2020 1:55 pm
The bug reporting system says in large caps
IMPORTANT: POST ONLY 0.19dev BUG REPORTS
but I am still using 0.18.
Should I ignore that headline?
Yep. In the ticket you can copy-paste my own information (in my 1st post in this thread). I had confirmed it still exists in 0.19.
Jee-Bee
Posts: 2189
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Spreadsheet delete value possible bug

Postby Jee-Bee » Fri Nov 13, 2020 9:15 pm

AndrewCSP wrote:
Fri Nov 13, 2020 1:55 pm
The bug reporting system says in large caps
IMPORTANT: POST ONLY 0.19dev BUG REPORTS
but I am still using 0.18.
Should I ignore that headline?
Normaly if you think you found a bug... check the current 0.xx development version and check if the bug still exist.
hyarion
Posts: 54
Joined: Fri Jun 26, 2020 6:08 pm

Re: Spreadsheet delete value possible bug

Postby hyarion » Fri Jan 01, 2021 6:18 pm

I've created a pull request with a fix for this issue: https://github.com/FreeCAD/FreeCAD/pull/4232

And here's the bug report that AndrewCSP created before: issue #4492
openBrain
Posts: 5209
Joined: Fri Nov 09, 2018 5:38 pm

Re: Spreadsheet delete value possible bug

Postby openBrain » Fri Jan 01, 2021 8:02 pm

hyarion wrote:
Fri Jan 01, 2021 6:18 pm
I've created a pull request with a fix for this issue: https://github.com/FreeCAD/FreeCAD/pull/4232

And here's the bug report that AndrewCSP created before: issue #4492
Great. Notice it's better if your commit message contains something like 'fixes #4492' so ticket is automatically closed at merge time. ;)