FreeCAD icon indicating copy to clipboard operation
FreeCAD copied to clipboard

TechDraw: Units of Area Annotation

Open Pendelf opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Problem description

When measuring area, the global unit of measure mm2 is used, and as a rule a value in m2 is required. It may be worth adding the ability to select the area units in the measurement properties and/or TechDraw settings

Снимок экрана 2024-12-15 225401

Full version info

OS: Windows 11 build 26100
Architecture: x86_64
Version: 1.1.0dev.39646 (Git) Conda
Build type: Release
Branch: main
Hash: b25b83c1a58bf0ae95cbd502d0ccae27e8127cad
Python 3.11.11, Qt 5.15.15, Coin 4.0.3, Vtk 9.3.0, OCC 7.8.1
Locale: Russian/Russia (ru_RU)
Stylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/Fusion
Installed mods: 
  * Curves 0.6.52
  * fasteners 0.5.33
  * PieMenu 1.10.2
  * sheetmetal 0.6.2

Subproject(s) affected?

TechDraw

Anything else?

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Pendelf avatar Dec 15 '24 16:12 Pendelf

I would like to add that the ability to change units of measurement in the property would be useful not only in Tech Draw, but also in other places. Global settings of units of measurement are good, but very often you have to combine different units of measurement, but now there is no such option. We are limited to the global choice.

kaiwas avatar Dec 15 '24 20:12 kaiwas

Every dimension object in TechDraw has a getRawValue() method (send the dimension to the Python console and do obj.getRawValue() ).

Unfortunately, the result of this is not available in the Data panel.

If it were, it could be used in an Expression for the Format Spec of the displayed dimension.

That way, you could have an area in square millimetres and divide it by 1e^6 in the Format to see square metres.

It would allow far greater user control over combining units - among other things, it would allow very easy dual imperial/metric dimensioning.

pitch-circle avatar Dec 17 '24 08:12 pitch-circle

This needs a read-only Property added to Dimension (called RawValue?) and mods to DrawViewDimensionPy.xml and DrawViewDimensionPyImp.cpp to add the attribute and a getter that calls getRawValue.

Then the raw value would be accessible to expressions. Still have to handle the conversion from internal mm to the current units schema.

WandererFan avatar Dec 20 '24 14:12 WandererFan

Please help me understand what this issue is about! My problem is that when unit system is set to Building Euro, cm, m², m³ then linear measurements are correctly in cm, but area is in cm² instead of the set m². Does this issue cover that bug?

(Do I guess right that this should not stayed unfixed for v1.0.0?)

OS: Debian GNU/Linux forky/sid (XFCE/xfce/xcb)
Architecture: x86_64
Version: 1.0.0.
Build type: Release
Python 3.13.5, Qt 5.15.15, Coin 4.0.3, Vtk 9.3.0, OCC 7.8.1
Locale: C/Default (C)
Stylesheet/Theme/QtStyle: FreeCAD Light.qss/FreeCAD Light/Fusion

grinapo avatar Sep 27 '25 19:09 grinapo

(Do I guess right that this should not stayed unfixed for v1.0.0?)

Yes, this most definitely will not make it into 1.0.x or the upcoming 1.1 (since we already are in a feature freeze).

@Pendelf would you be so kind to update the ticket name to something more descriptive ?

luzpaz avatar Sep 27 '25 21:09 luzpaz

(I don't think it's about convenience: the actual unit system claims that areas are in m². Also I believe there is three separate things were mentioned here:

  • when the unit system claims areas are in a specific unit then they should be (this really should be fixed),
  • would be nice to be able to override the units separately (I guess that's what #22883 is about, i'ts been told that it's not that simple)
  • would be nice to be able to override dimensions separately (I am not sure how feasible this is at all).

[Though I am, as a new user, extremely confused by the unit system, since, for example, font sizes seem to be calculated by the units but limited to one decimals, so for a floor plan they cannot be set {in meters!} without switching the unit system to and from.])

grinapo avatar Sep 28 '25 11:09 grinapo

@grinapo units system saw more improvements in 1.1.0dev
Can you give it a test run ?

luzpaz avatar Sep 28 '25 12:09 luzpaz

This one is fixed? Don't know the PR that did it.

Image

WandererFan avatar Sep 28 '25 13:09 WandererFan

@grinapo units system saw more improvements in 1.1.0dev Can you give it a test run ?

Is there anything in particular I shall look out for? It seems to work the same way.

grinapo avatar Sep 28 '25 15:09 grinapo

Did we ever check the document level unit schema vs the system level schema here?

WandererFan avatar Sep 29 '25 12:09 WandererFan

@luzpaz If you meant setting the font sizes for example then yes, now it seems to be possible to enter arbitrarily precise numbers (as well as setting manually the units in mm, as now I have realised), but it still displayed as the set unit, with one decimal precision, so, for example, I get them in cm, and I can set it to 0.1 mm but it gets displayed as 0.0 cm (while it seems to be handled properly as 0.1 mm) and that's also the value (0.0 cm) offered for editing it. But this is possibly offtopic in this issue, so I apologise.

grinapo avatar Sep 29 '25 13:09 grinapo