Sketcher: "Name (optional)" field accepts any character

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
hmk
Posts: 159
Joined: Tue Sep 29, 2020 1:19 pm
Location: Berlin, Germany

Re: Sketcher: "Name (optional)" field accepts any character

Post by hmk »

For the record: It seems that all names that are identical with units have this "feature". There are quite a few units, including:
- A
- F
- M, m
- N
- S
- ... https://wiki.freecadweb.org/Expressions#Units

Note to self: Do not use single characters as names, many potential clashes!

This has been already discussed: https://tracker.freecadweb.org/view.php?id=3379
hmk
Posts: 159
Joined: Tue Sep 29, 2020 1:19 pm
Location: Berlin, Germany

Re: Sketcher: "Name (optional)" field accepts any character

Post by hmk »

kisolre wrote: Fri Jan 15, 2021 12:36 pm
hmk wrote: Fri Jan 15, 2021 11:08 am I guess my point is: As a newbie, I would like to have a definition what constitutes a legal name
That is the point. Legal for what? If you dont want to use it in expressions any name should be legal. If you want to use it in expressions - you are expected to nave an idea how those work and what are their limitations. So should we limit all other usage scenarios just because one of them has limitations?
I see, I did not think about the different kinds of usages. I don't have the competence how this can be solved in a reasonable way. A warning message if the names clashes with a unit, etc. may an option. Something like
"Your name clashes with a reserved word. The name cannot be referenced in an expression. See <link to documentation>"
Perhaps this warning message could be generated on-the-fly right under the input field.
3DOKIE
Posts: 43
Joined: Sat Jan 16, 2021 1:36 am

Re: Sketcher: "Name (optional)" field accepts any character

Post by 3DOKIE »

Thanks for the feedback Chris.
Post Reply