Sorry, did not realize that you introduced these settings as switches in the preferences . Very nice
Many thanks for the very detailed explanation.
Best regards,
Wilfried
Sorry, did not realize that you introduced these settings as switches in the preferences . Very nice
Because that tip is for python and TechDraw is programmed in C++? You can get your number back by changing the FormatSpec property back to "%.2f". FormatSpec was originally intended to create something like "TextBeforeValue 10.00 TextAfterValue".reox wrote: ↑Sun Nov 05, 2017 8:40 pm I wonder why this does not work: https://stackoverflow.com/a/2440708/446140
I checked it by setting it for a dimension, but all I get is this:
2017-11-05-213831_667x383_scrot.png
In my opinion, %g would be veeeery convenient for many drawings! (And I just learned that this formatter even exists )
(a better explaination is here: http://en.cppreference.com/w/cpp/io/c/fprintf)double in either normal or exponential notation, [...] This type differs slightly from fixed-point notation in that insignificant zeroes to the right of the decimal point are not included. Also, the decimal point is not included on whole numbers.
Code: Select all
#include <stdio.h>
int main() {
int x = 10;
double z = 23.1;
float y = 23.001;
double bla = 42.23;
double foo = 42.0;
printf("10 --> %g\n", x);
printf("23.001 --> %g\n", y);
printf("23.1 --> %g\n", z);
printf("42.23 --> %g\n", bla);
printf("42.0 --> %g\n", foo);
return 0;
}
Code: Select all
10 --> 6.95325e-310
23.001 --> 23.001
23.1 --> 23.1
42.23 --> 42.23
42.0 --> 42
Code: Select all
for v in App.activeDocument().findObjects("TechDraw::DrawViewDimension"):
v.LineWidth = 0.25
v.FormatSpec = u"%.5g"
should be fixed by git commit 9d038dd