Skip to content

[For v0.19]Fix ObjectIdentifier ambiguity

Jonathan Wiedemann requested to merge github/fork/realthunder/OIDAmbiguity into master

Created by: realthunder

There is an ambiguity problem in ObjectIdentifier. If there are more than one component, then the first component can either be interpreted as an object name, object label, or property name. This file demonstrate the problem. Cube.Height binds to an expression Placement.Base.x+10mm, which is not working because there is an object with label Placement. The named constraint in the sketch cannot be deleted, because SketchObject internally uses ObjectIdentifier for its PropertyConstraintList named Constraints, and the object with the label Placement has an internal name of Constraints.

Commit 6732008a reduces the ambiguity of existing expression (Edit: this commit has been refined by 655d6fe6)

Commit d5eeee7c modifies the ObjectIdentifier constructor to make it easy for other code to explicitly set the object name.

Commit 3c4750a8 modifies all code (that I can find) that uses ObjectIdentifier to use explicit object name.

Commit 47c4a3b7 add a new syntax to expression to allow explicit object name when the path starts with a dot.

We probably should forbid direct referencing of a property without a leading dot.

Merge request reports