View Issue Details

IDProjectCategoryView StatusLast Update
0002766Expressions[FreeCAD] Bugpublic2019-02-25 13:38
ReporterFFW Assigned Toeivindkvedalen  
PrioritynormalSeverityminorReproducibilityhave not tried
Status assignedResolutionopen 
Platformx86-64OSLinux DebianOS Version4.8.0-1-amd64
Product Version[FreeCAD] 0.16 
Target Version[FreeCAD] 0.19Fixed in Version 
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.
Tagsexpressions
FreeCAD Information

Activities

wmayer

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.

eivindkvedalen

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?

wmayer

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.

wmayer

2017-10-11 12:52

administrator   ~0010291

See also:
https://forum.freecadweb.org/viewtopic.php?f=10&t=24839&p=195041
https://forum.freecadweb.org/viewtopic.php?f=10&t=24595&p=194633#p194633

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