Part Design draft angle does not accept units

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!
Post Reply
nahshon
Posts: 225
Joined: Wed Jul 24, 2013 8:06 pm

Part Design draft angle does not accept units

Post by nahshon »

I tried to get the graft angle from an expression with unit '10 deg'. The dialog accepted the units but when I confirmed with "OK" I got an unexpected error message "std::bad_cast".
err1.png
err1.png (50.86 KiB) Viewed 881 times
Then I tried to do that using the property panel and got the explanation, units are not expected here!
The attachment err2.png is no longer available
It looks like a bug, I do not know what's the expected behavior. Is there a way to allow units and maintain compatibility with documents that do not use units?
Attachments
err2.png
err2.png (49.55 KiB) Viewed 881 times
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Part Design draft angle does not accept units

Post by TheMarkster »

The property type chosen for the Angle is FloatConstraint rather than Angle, not sure why. A workaround is to add /deg to your formula.

For example, suppose you have an angle constraint in a sketch you want to refer to for the draft angle.

Instead of

Sketch.Constraints.my_angle

you would use

Sketch.Constraints.my_angle/deg
Last edited by TheMarkster on Mon Aug 12, 2019 9:41 pm, edited 1 time in total.
nahshon
Posts: 225
Joined: Wed Jul 24, 2013 8:06 pm

Re: Part Design draft angle does not accept units

Post by nahshon »

I know the work-around. Looking for a real fix.
chrisb
Veteran
Posts: 54309
Joined: Tue Mar 17, 2015 9:14 am

Re: Part Design draft angle does not accept units

Post by chrisb »

TheMarkster wrote: Mon Aug 12, 2019 6:54 pm Sketch.Constraints.my_angle/dev
Typo?
Sketch.Constraints.my_angle/deg
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Part Design draft angle does not accept units

Post by TheMarkster »

chrisb wrote: Mon Aug 12, 2019 9:17 pm
TheMarkster wrote: Mon Aug 12, 2019 6:54 pm Sketch.Constraints.my_angle/dev
Typo?
Sketch.Constraints.my_angle/deg
Good eye.
Post Reply