Measure Line colour and text size

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!
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: Measure Line colour and text size

Post by vm4dim »

adrianinsaval wrote: Thu Jun 23, 2022 7:20 pm but how to set those parameters? freecad's way of saving color parameters has always been weird

Tools > Edit Parameters
BaseApp > Preferences > View
Create Text Parameter: Dimensions3dColor, DimensionsDeltaColor or DimensionsAngularColor
Format: #RRGGBB
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Measure Line colour and text size

Post by adrianinsaval »

thanks it works, a lot of other color parameters on freecad unfortunately are saved as an "unsigned int" whatever that is and I don't what black magic ritual you have to perform to go from RGB values to that.
try vm4din's suggestion @NHSA_Rainer

Edit: documented this now in Fine-tuning
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: Measure Line colour and text size

Post by vm4dim »

NHSA_Rainer wrote: Thu Jun 23, 2022 6:35 pm ... this is a so called hardcoded issue and well will have to live with it :(

Why hard? This is Open Source.
A little magic and Font/Size can also be changed.
Attachments
Measure.png
Measure.png (27.02 KiB) Viewed 1041 times
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: Measure Line colour and text size

Post by vm4dim »

[PartGui] Use Parameters for Measure labels font name and size #7088.
https://github.com/FreeCAD/FreeCAD/pull/7088

Parameters can be set in the Python console

Code: Select all

FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View").SetString("DimensionsFontName", "FreeMono :Bold")
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View").SetUnsigned("DimensionsFontSize", 36)

FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View").SetString("Dimensions3dColor",     "#FFFF00")
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View").SetString("DimensionsDeltaColor",  "#FFFFFF")
FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View").SetString("DimensionsAngularColor","#0000FF")

FreeCADGui.runCommand('Part_Measure_Refresh',0)
NHSA_Rainer
Posts: 104
Joined: Mon Aug 30, 2021 3:37 pm

Re: Measure Line colour and text size

Post by NHSA_Rainer »

Hi vm4dim, adrianinsaval et Al.

Thank you very much but please do not misunderstand me.

I am a 69 year old retiree (soon 70) and have 0 clue about programming and especially getting into the bowels of such a highly sophisticated program like FreeCAD.

Sorry for being dumb ... and not daring to destroy my running software.

Have a nice weekend.

Rainer
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Measure Line colour and text size

Post by adrianinsaval »

the color change does not require any programming at all! The interface to change is cumbersome though, perhaps they could be shown as option in the task widget.
NHSA_Rainer
Posts: 104
Joined: Mon Aug 30, 2021 3:37 pm

Re: Measure Line colour and text size

Post by NHSA_Rainer »

adrianinsaval wrote: Fri Jun 24, 2022 11:43 pm the color change does not require any programming at all! The interface to change is cumbersome though, perhaps they could be shown as option in the task widget.
Thanks.

I have tried according to the instructions but do not advance much after opening Tools > Edit parameters ...

What makes me a bit dizzy is the following

" Create Text Parameter: Dimensions3dColor, DimensionsDeltaColor or DimensionsAngularColor "

and especially the word " or " ...

Hw do I know what to add in that sentence. Is the or applying to the whole sentence or does it mean I have to create 3 new lines

consiting how ?

and where would this new setting appear ?

A big help would be to show me an example of how it is created via screenshots.

Thanks Rainer
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Measure Line colour and text size

Post by Roy_043 »

NHSA_Rainer
Posts: 104
Joined: Mon Aug 30, 2021 3:37 pm

Re: Measure Line colour and text size

Post by NHSA_Rainer »

Roy_043 wrote: Sat Jun 25, 2022 8:35 am Have you read Std_DlgParameter#New_string_item?
Hi,

I just read it, not once but a few times, but still full of questions about how to implement it, define a colour via a text string and where will I see the added result or will this just in hidden way change the parameters of the measure lines ?

Sorry for not understanding this.

Rainer
vm4dim
Posts: 129
Joined: Tue Nov 23, 2021 1:05 am

Re: Measure Line colour and text size

Post by vm4dim »

NHSA_Rainer wrote: Sun Jun 26, 2022 7:38 pm where will I see the added result or will this just in hidden way change the parameters of the measure lines ?
Push https://wiki.freecadweb.org/Part_Measure_Refresh
Post Reply