Ticket #4197 - Error Using Expression to Fill PropertyString

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
wandererfan
Posts: 4078
Joined: Tue Nov 06, 2012 5:42 pm

Ticket #4197 - Error Using Expression to Fill PropertyString

Postby wandererfan » Mon Nov 18, 2019 12:27 pm

Is there a problem using spreadsheet cell value to fill a PropertyString? I've tried with a few different PropertyStrings and the behaviour seems consistent.

Starting with the attached file,
- Select "Cube"
- select "Rename" from RMB context menu
- press Expression icon
- assign "Spreadsheet.A1" as new Label
- press Recompute
- result :

Code: Select all

<Exception> basic_string::_M_construct null not valid
in property binding 'Label'
101.749 <App> Document.cpp(3440): Failed to recompute ExpressionRefToSpreadsheet#Box: basic_string::_M_construct null not valid
in property binding 'Label'
Recompute failed! Please check report view.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
<class 'SystemError'>: <built-in method recompute of App.Document object at 0x5595de0a3cb8> returned a result with an error set
<Exception> basic_string::_M_construct null not valid
in property binding 'Label'
120.544 <App> Document.cpp(3440): Failed to recompute ExpressionRefToSpreadsheet#Box: basic_string::_M_construct null not valid
in property binding 'Label'
Recompute failed! Please check report view.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
<class 'SystemError'>: <built-in method recompute of App.Document object at 0x5595de0a3cb8> returned a result with an error set
And a popup:
DependencyCycles.png
DependencyCycles.png (17.2 KiB) Viewed 596 times

OS: Linux Mint 19 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)
Attachments
ExpressionRefToSpreadsheet.FCStd
(4.06 KiB) Downloaded 9 times
Last edited by Kunda1 on Fri Nov 29, 2019 12:51 pm, edited 1 time in total.
Reason: Added ticket number to thread title
chrisb
Posts: 27983
Joined: Tue Mar 17, 2015 9:14 am

Re: Error Using Expression to Fill PropertyString

Postby chrisb » Mon Nov 18, 2019 2:10 pm

FreeCAD crashes if I recompute your file.
chrisb
Posts: 27983
Joined: Tue Mar 17, 2015 9:14 am

Re: Error Using Expression to Fill PropertyString

Postby chrisb » Mon Nov 18, 2019 2:24 pm

I investigated this a bit further
- If I enter an expression Spreadsheet.A1 for the label, the contents of A1 is shown correctly
- however, the cube is still marked for recompute
- if I recompute, FreeCAD crashes
- I experience the same behaviour as in the previous 3 steps if I use an alias for Cell A1

- I can save the file before the recompute is performed
- when I reopen it, the cube has the new name and is marked for recompute.
- and if I recompute, ... (see above)

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18694 (Git)
Build type: Release
Branch: master
Hash: c3ba04183e016e15410d84bae4d00556d22c7da5
Python version: 3.7.3
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
User avatar
wandererfan
Posts: 4078
Joined: Tue Nov 06, 2012 5:42 pm

Re: Error Using Expression to Fill PropertyString

Postby wandererfan » Tue Nov 19, 2019 12:21 pm

adrianinsaval
Posts: 344
Joined: Thu Apr 05, 2018 5:15 pm

Re: Error Using Expression to Fill PropertyString

Postby adrianinsaval » Sun Dec 08, 2019 2:33 am

ezzieyguywuf wrote:
realthunder wrote:
Sorry to bother you guys, maybe one of you is willing to tackle this issue?
realthunder
Posts: 1755
Joined: Tue Jan 03, 2017 10:55 am

Re: Ticket #4197 - Error Using Expression to Fill PropertyString

Postby realthunder » Mon Dec 09, 2019 12:41 am

PR submitted here
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
adrianinsaval
Posts: 344
Joined: Thu Apr 05, 2018 5:15 pm

Re: Ticket #4197 - Error Using Expression to Fill PropertyString

Postby adrianinsaval » Mon Dec 16, 2019 8:37 pm

realthunder wrote:
Mon Dec 09, 2019 12:41 am
PR submitted here
Thanks!