View Issue Details

IDProjectCategoryView StatusLast Update
0002766ExpressionsBugpublic2021-02-06 06:30
ReporterFFW Assigned Toeivindkvedalen  
PrioritynormalSeverityminorReproducibilityhave not tried
Status assignedResolutionopen 
Platformx86-64OSLinux DebianOS Version4.8.0-1-amd64
Product Version0.16 
Target Version0.20 
Summary0002766: Expression link is cuting by creating new object
DescriptionWhen using an expression linked to a certain object, creating another object with a close name cause the link to switch to this last created.
Steps To Reproduce- Create a Part Design/Cube, named Cube by default
- Create another object
- Link a property of this object to Cube.Length
- Create another Part Design/Cube, named Cube001 by default
- Show the property of the object, it is now linked to Cube001.Length and break the model.
FreeCAD Information



2016-11-11 12:23

administrator   ~0007447

Hint: this only happens with using the Label value of an object (Cube). When using its internal name (in this case "Box") it works correctly.

The same problem still exists in 0.17.


2016-11-13 21:55

developer   ~0007452

This happens because the GUI tries to assign e.g 'Cube' to the second object when it is created. This in turn triggers a relabelObject signal, and the expression engine happily renames the expression when the GUI changes the label because duplicate labels are not allowed (before this happens there are two object with the label 'Cube'; this is why it can be renamed to Cube001; not sure why this is so predictable, though).

Not sure how to fix this, because I also found another thing that probably should be looked into first: The "Allow duplicate label" handling is done in the Gui part of FreeCAD. Shouldn't this really be in the App part?


2016-11-14 17:53

administrator   ~0007453

> Shouldn't this really be in the App part?
True, since ObjectLabelObserver anyway only accesses App stuff this class could be moved to FreeCADApp.


2017-10-11 12:52

administrator   ~0010291

See also:


2022-03-03 13:55

administrator   ~0016507

This ticket has been migrated to GitHub as issue 5672.

Issue History

Date Modified Username Field Change
2016-11-11 09:23 FFW New Issue
2016-11-11 12:23 wmayer Note Added: 0007447
2016-11-11 12:23 wmayer Status new => confirmed
2016-11-11 21:06 eivindkvedalen Assigned To => eivindkvedalen
2016-11-11 21:06 eivindkvedalen Status confirmed => assigned
2016-11-13 21:55 eivindkvedalen Note Added: 0007452
2016-11-14 17:53 wmayer Note Added: 0007453
2017-05-07 15:01 Kunda1 Tag Attached: expressions
2017-10-11 12:52 wmayer Note Added: 0010291
2017-12-13 15:29 Kunda1 Project FreeCAD => Expressions
2019-02-25 13:38 Kunda1 Target Version => 0.19
2021-02-06 06:30 abdullah Target Version => 0.20