Expressions and Renaming of Sketches etc.

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
chrisb
Posts: 29060
Joined: Tue Mar 17, 2015 9:14 am

Expressions and Renaming of Sketches etc.

Postby chrisb » Tue Aug 08, 2017 6:00 pm

In the attached Model I use Expressions
- I have given the name "R" to the radius of Sketch
- I use it in the second sketch, dividing it by 2 and give that small radius the name "r"
- I pad the second sketch and use an expression Sketch001.r for the length.

Next I want to rename the Sketch001 to something more sensible, let's say "SketchInner"

I go to the Data Tab and delete "001". The problem is, that on every keystroke the name is set - to be seen in the python console. So there is a point where both sketches have the same name. I add "Inner" and leave the input field. I had expected that the second pad would break, but the second sketch breaks as well, because instead of "Sketch.R" it uses now "SketchI.R". The renaming mechanism inserts the first "I" of "Inner".
Is this known or is it worth a ticket?
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11740 (Git)
Build type: Release
Branch: (detached from 6b05302)
Hash: 6b05302c2e70f191a2a5787f55c5b549155b9824
Python version: 2.7.13
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
Attachments
Bildschirmfoto 2017-08-08 um 19.59.26.png
Bildschirmfoto 2017-08-08 um 19.59.26.png (76.63 KiB) Viewed 645 times
ExpressionsRename.FCStd
(10.7 KiB) Downloaded 15 times
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Expressions and Renaming of Sketches etc.

Postby eivindkvedalen » Tue Aug 08, 2017 7:41 pm

chrisb wrote:
Tue Aug 08, 2017 6:00 pm
In the attached Model I use Expressions
- I have given the name "R" to the radius of Sketch
- I use it in the second sketch, dividing it by 2 and give that small radius the name "r"
- I pad the second sketch and use an expression Sketch001.r for the length.

Next I want to rename the Sketch001 to something more sensible, let's say "SketchInner"

I go to the Data Tab and delete "001". The problem is, that on every keystroke the name is set - to be seen in the python console. So there is a point where both sketches have the same name. I add "Inner" and leave the input field. I had expected that the second pad would break, but the second sketch breaks as well, because instead of "Sketch.R" it uses now "SketchI.R". The renaming mechanism inserts the first "I" of "Inner".
Is this known or is it worth a ticket?
Yes, please make a ticket for this case.

Eivind
chrisb
Posts: 29060
Joined: Tue Mar 17, 2015 9:14 am

Re: Expressions and Renaming of Sketches etc.

Postby chrisb » Tue Aug 08, 2017 8:34 pm

A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
chrisb
Posts: 29060
Joined: Tue Mar 17, 2015 9:14 am

Re: Expressions and Renaming of Sketches etc.

Postby chrisb » Tue Aug 08, 2017 8:38 pm

Perhaps this could be solved if the changes are applied at the leave event. That's when the recompute starts.
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
User avatar
Kunda1
Posts: 8772
Joined: Thu Jan 05, 2017 9:03 pm

Re: Expressions and Renaming of Sketches etc.

Postby Kunda1 » Mon Aug 14, 2017 2:48 pm

eivindkvedalen wrote:
Tue Aug 08, 2017 7:41 pm
Yes, please make a ticket for this case.
Eivind
Eivind, can I assign this ticket to you?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features