Expressions and Renaming of Sketches etc.

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
chrisb
Veteran
Posts: 54124
Joined: Tue Mar 17, 2015 9:14 am

Expressions and Renaming of Sketches etc.

Post by chrisb »

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 1979 times
ExpressionsRename.FCStd
(10.7 KiB) Downloaded 38 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.

Post by eivindkvedalen »

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
Veteran
Posts: 54124
Joined: Tue Mar 17, 2015 9:14 am

Re: Expressions and Renaming of Sketches etc.

Post by chrisb »

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

Re: Expressions and Renaming of Sketches etc.

Post by chrisb »

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
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Expressions and Renaming of Sketches etc.

Post by Kunda1 »

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?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
adrianinsaval
Veteran
Posts: 5544
Joined: Thu Apr 05, 2018 5:15 pm

Re: Expressions and Renaming of Sketches etc.

Post by adrianinsaval »

chrisb wrote: Tue Aug 08, 2017 6:00 pm
Can you still reproduce this issue? I can't

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.27809 (Git)
Build type: Release
Python 3.8.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: Spanish/Paraguay (es_PY)
Installed mods: 
  * ArchTextures
  * CurvedShapes 1.0.0
  * Curves 0.3.0
  * Defeaturing
  * fasteners 0.3.38
  * Glass
  * SelectorToolbar
  * Silk -1516479696.0.0
chrisb
Veteran
Posts: 54124
Joined: Tue Mar 17, 2015 9:14 am

Re: Expressions and Renaming of Sketches etc.

Post by chrisb »

It is fixed.
I wanted to close the ticket but have no idea how to do so.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
adrianinsaval
Veteran
Posts: 5544
Joined: Thu Apr 05, 2018 5:15 pm

Re: Expressions and Renaming of Sketches etc.

Post by adrianinsaval »

I think you need special permissions for that because github probably doesn't know it was you that opened it.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Expressions and Renaming of Sketches etc.

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply