Text position for dimensions

A forum dedicated to the Draft, Arch and BIM workbenches development.
brjhaverkamp
Posts: 117
Joined: Thu Sep 24, 2015 3:14 pm

Text position for dimensions

Postby brjhaverkamp » Sat Oct 12, 2019 6:10 pm

Hello all,

I might misunderstand the way the text position for dimension lines works. But if I even change the position by 1mm in either x,y or z direction, the text is completely gone.

Background is that I want to change the text position of the "200mm" in the first screenshot to be on the right of the dimension arrow.
I can move the text "upward" by the text spacing value, but I can't find a way to change it to the right.
I would also have the dimension line be extended to the right only, so the text could sit on the extended line.
But the Dim Overshoot works only symmetrical.
File: https://www.oatfield.nl/nextcloud/index ... 8QJ287QHoX
Screenshot (6).png
Screenshot (6).png (274.75 KiB) Viewed 622 times
Screenshot (7).png
Screenshot (7).png (271.19 KiB) Viewed 622 times
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

Kind regards,

Bert
vocx
Posts: 4644
Joined: Thu Oct 18, 2018 9:18 pm

Re: Text position for dimensions

Postby vocx » Mon Oct 14, 2019 12:08 am

brjhaverkamp wrote:
Sat Oct 12, 2019 6:10 pm
I might misunderstand the way the text position for dimension lines works. But if I even change the position by 1mm in either x,y or z direction, the text is completely gone.
...
Mmm. If I remember correctly, the position of the text uses as reference the absolute origin (0,0,0), which means that the text didn't disappear, it just moved 1 mm next to the origin. This is a very strange behavior. Maybe it can be improved. You could use some Expressions here; something like End.x + 1mm.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.
brjhaverkamp
Posts: 117
Joined: Thu Sep 24, 2015 3:14 pm

Re: Text position for dimensions

Postby brjhaverkamp » Mon Oct 14, 2019 9:50 am

Thanks vocx, I should have come up with that one.

But this definitely calls for a request to change the behaviour. This is one of those little usability thingies:-)
@Yorik, Can it please be changed to one of the two behaviors below?
A) The position values start at 0, but any value filled in is interpreted as relative displacement wrt the default placement.
B) The position values are prefilled with the actual default absolute placement values and from there you can increase or decrease it at your liking

I think option B has better chances for backward compatibility.

Kind regards,

Bert
User avatar
yorik
Site Admin
Posts: 11978
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Text position for dimensions

Postby yorik » Mon Oct 14, 2019 7:57 pm

The thing about the absolute position, is that dimensions can be parametric. So their baseline can change if the measured object changes. That would move the dim text, although by moving it you kind of say "i want it there and not automatic". More or less same as autocad.

But indeed I have almost never seen it used that way... Indeed we could make it relative to the line center...
vocx
Posts: 4644
Joined: Thu Oct 18, 2018 9:18 pm

Re: Text position for dimensions

Postby vocx » Mon Oct 14, 2019 10:47 pm

yorik wrote:
Mon Oct 14, 2019 7:57 pm
...
But indeed I have almost never seen it used that way... Indeed we could make it relative to the line center...
I thought about simply using an expression, like

Code: Select all

text position = obj.End.x + 2mm
However, I realize now that the text position is actually a property of the view provider, not of the object itself. This makes sense, I guess, but at the same time, wouldn't it be better for it to be part of the regular object properties? I never thought about this before but view provider properties cannot use the Expressions engine. In my opinion, everything that receives a numerical input is suitable for an expression, including position vectors and distances (or things like font sizes and scales).
realthunder wrote:
Mon Oct 14, 2019 12:47 am
vocx wrote:
Mon Oct 14, 2019 12:24 am
I have a question. Are View properties (view provider) in the Property editor able to use Expressions?
It is not possible at the moment. The expression bindings are stored and processed by a property called ExpressionEngine that is contained in every document object. There is no such thing in view provider. It is of course possible to extend expression engine to support view property, but it is going to take quite some effort. A much simpler way is to change the implementation of Dimension. Either move the property to object, or add a new one to object, and sync the value in ViewObject.updateData().
Would it make sense to add some of these visual properties to the object, instead of its view provider?
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.