Sketcher's parameters

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
UR_
Posts: 1188
Joined: Tue Jan 03, 2017 8:42 pm

Re: Sketcher's parameters

Postby UR_ » Fri Nov 30, 2018 2:47 pm

chrisb wrote:
Fri Nov 30, 2018 2:31 pm
Some names
Actually these are used as units:

(A stands for ampere)

Code: Select all

nm
um
µm
mm
cm
dm
m
km
l
ug
µg
mg
g
kg
t
s
min
h
A
mA
kA
MA
K
mK
µK
uK
mol
cd
in
\
ft
'
thou
mil
yd
mi
lb
lbm
oz
st
cwt
lbf
N
kN
MN
mN
Pa
kPa
MPa
GPa
Torr
mTorr
uTorr
µTorr
psi
ksi
W
VA
J
Nm
VAs
CV
Ws
°
deg
rad
gon
koluna
Posts: 276
Joined: Thu Sep 20, 2018 12:36 pm

Re: Sketcher's parameters

Postby koluna » Fri Nov 30, 2018 3:06 pm

Oh, I used "A". It is my error! Thanks a lot! :)
User avatar
DeepSOIC
Posts: 7667
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Sketcher's parameters

Postby DeepSOIC » Fri Nov 30, 2018 3:35 pm

UR_ wrote:
Fri Nov 30, 2018 2:47 pm
Actually these are used as units:

(A stands for ampere)
Actually, I'd say it's a bug. Units follow a number or an operator, but attributes follow some name and a dot. So they can be told apart, parser can be improved.
UR_
Posts: 1188
Joined: Tue Jan 03, 2017 8:42 pm

Re: Sketcher's parameters

Postby UR_ » Fri Nov 30, 2018 3:55 pm

If a constraint named "A" exists, this gives a parser result:

2018-11-30 16_49_23-Window.png
2018-11-30 16_49_23-Window.png (9.49 KiB) Viewed 324 times

Unfortunately only temporary joy, until you hit [Enter] :?
chrisb
Posts: 25890
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher's parameters

Postby chrisb » Fri Nov 30, 2018 4:47 pm

UR_ wrote:
Fri Nov 30, 2018 2:47 pm
Actually these are used as units:

Code: Select all

nm
um
µm
mm
...
Thanks for the insight. It makes things much clearer for me. I think too that the parser could be improved, but until then we have at least an explanation.
@UR_: would you mind adding this to the wiki documentation of the Expressions?
koluna
Posts: 276
Joined: Thu Sep 20, 2018 12:36 pm

Re: Sketcher's parameters

Postby koluna » Tue Dec 11, 2018 11:20 am

Hi!
How can I use my global parameters?
I want to set some parameters and they must be used in different scketches in my project.
koluna
Posts: 276
Joined: Thu Sep 20, 2018 12:36 pm

Re: Sketcher's parameters

Postby koluna » Tue Dec 11, 2018 7:07 pm

It is an answer: https://www.freecadweb.org/wiki/Expressions
There is no concept of global variables in FreeCAD at the moment. Instead, arbitrary variables can be defined as cells in a spreadsheet using the Spreadsheet workbench, and then be given a name using the alias property for the cell (right-click on cell). Then they can be accessed from any expression just as any other object property.
It really works :)
UR_
Posts: 1188
Joined: Tue Jan 03, 2017 8:42 pm

Re: Sketcher's parameters

Postby UR_ » Tue Dec 11, 2018 11:50 pm

koluna wrote:
Tue Dec 11, 2018 7:07 pm
It is an answer: ...
There is a second way saving parameters without using a spreadsheet.

Please have a look at this workbench:
https://github.com/mwganson/DynamicData ... /README.md
koluna
Posts: 276
Joined: Thu Sep 20, 2018 12:36 pm

Re: Sketcher's parameters

Postby koluna » Wed Dec 12, 2018 9:17 am

Thanks!
But can I use it so?
User avatar
uwestoehr
Posts: 1657
Joined: Sun Jan 27, 2019 3:21 am

Re: Sketcher's parameters

Postby uwestoehr » Fri Jun 21, 2019 1:30 am

chrisb wrote:
Fri Nov 30, 2018 4:47 pm
@UR_: would you mind adding this to the wiki documentation of the Expressions?
done: https://www.freecadweb.org/wiki/Expressions#Units