View Issue Details

IDProjectCategoryView StatusLast Update
0003518Expressions[FreeCAD] Bugpublic2019-08-13 15:08
Reporteramrit3701Assigned Towmayer 
PriorityhighSeveritymajorReproducibilityalways
Status assignedResolutionreopened 
Product Version[FreeCAD] 0.18 
Target VersionFixed in Version[FreeCAD] 0.18 
Summary0003518: Expressions (fx) not updated
DescriptionWhen I try to merge a parametric object in a new document, its expressions are not updated. For eg. suppose we have a parametric object which has an expression "object.Length.Value". And when I try to merge this object in some document which already have some objects, the newly merge object named as "object001" but its expression remains the same (i.e "object.Length.Value"). I expected that newly expression should changed as "object001.Length.Value".
Additional InformationOS: Ubuntu 16.04.4 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.13919 (Git)
Build type: None
Branch: master
Hash: 05bee3aa1fb8a27fa1528a50dc8f8b15ac5b0cce
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/India (en_IN)
TagsNo tags attached.

Relationships

has duplicate 0003462 closedwmayer Rename command - Rename of Spreadsheet in Document structure 

Activities

Kunda1

2018-06-22 13:04

administrator   ~0011462

Punting to @eivindkvedalen

wmayer

2018-11-11 09:59

administrator   ~0012174

https://github.com/FreeCAD/FreeCAD/commit/de074ec4f37ee8baf4c268a3bc528f4bddf8ac15

amrit3701

2019-07-06 10:16

reporter   ~0013336

@wmayer

Thanks for fixing this issue but there is still small bug present. The expression after the first operator (+, -, *, /) is not updated.

Explanation:
I have created a Cube using Part workbench and also created a sketch of rectangle. Expression of one side of the rectangle is "Box.Length" and other side is "Box.Length + Box.Length". This file has two objects (i.e. Box and sketch) and saved it as testing.fcstd.

Now, created a new document in FreeCAD, merged this testing.fcstd twice. This file has four objects (i.e. Box, Sketch, Box001 and Sketch001) and expressions of Sketch001 object are "[('Constraints[9]', 'Box001.Length'), ('Constraints[8]', 'Box001.Length + Box.Length')]".

The first expression is updated properly (Box.Length -> Box001.Length) but the expression in which operators are used is not updated properly ('Box.Length + Box.Length' -> 'Box001.Length + Box.Length'). It should be equal to `Box001.Length + Box001.Length`

Kunda1

2019-07-29 14:51

administrator   ~0013392

@wmayer should we assign this ticket to the 0.19 milestone?

yorik

2019-08-13 15:08

administrator   ~0013424

I think we would need to replace all occurences of the object name in the expression string, I could try that:
https://stackoverflow.com/questions/20406744/how-to-find-and-replace-all-occurrences-of-a-substring-in-a-string
But there might be dire implications, such as an object having the same name as a property.. Ex an object named Length...

Issue History

Date Modified Username Field Change
2018-06-20 16:20 amrit3701 New Issue
2018-06-22 13:03 Kunda1 Project FreeCAD => Expressions
2018-06-22 13:03 Kunda1 Assigned To => eivindkvedalen
2018-06-22 13:03 Kunda1 Status new => assigned
2018-06-22 13:04 Kunda1 Note Added: 0011462
2018-11-11 09:59 wmayer Assigned To eivindkvedalen => wmayer
2018-11-11 09:59 wmayer Status assigned => closed
2018-11-11 09:59 wmayer Resolution open => fixed
2018-11-11 09:59 wmayer Fixed in Version => 0.18
2018-11-11 09:59 wmayer Note Added: 0012174
2018-11-11 11:30 wmayer Relationship added has duplicate 0003462
2019-07-06 10:16 amrit3701 Status closed => feedback
2019-07-06 10:16 amrit3701 Resolution fixed => reopened
2019-07-06 10:16 amrit3701 Note Added: 0013336
2019-07-29 14:51 Kunda1 Note Added: 0013392
2019-07-29 14:52 Kunda1 Status feedback => assigned
2019-08-13 15:08 yorik Note Added: 0013424