Foro de Soporte Allplan

Number of decimals


In the Gld programming, there is a parameter, so that a dimension value, when there are zeros after the comma, shows them, and also how to delimit the number of decimals
I will explain myself better a dimension 1.234 is the one written with three decimals I would like 1.23 and if a value is 3.00 now it shows me 3
attached image.
Sincerely.

Adjuntos (1)

Type: image/x-ms-bmp
Descargado 588 veces
Size: 1,47 MiB

Use Syntax
STR (numeric_expression, length, fractions)

Adjuntos (1)

Type: image/png
Descargado 46 veces
Size: 29,47 KiB

Good afternoon Nemo.
Thanks for your answer. I use the syntax, but I can't reduce the decimals.
I attach several images:
image 1 smartpart with the result.
image 2 the V_COT value
Image 3 line 111 Syntax, 112 text V_COT

Adjuntos (3)

Type: image/x-ms-bmp
Descargado 560 veces
Size: 522,55 KiB
Type: image/x-ms-bmp
Descargado 636 veces
Size: 62,47 KiB
Type: image/x-ms-bmp
Descargado 589 veces
Size: 159,20 KiB

Hello,

Nemo gave an example. Please, read the online help on the bottom of the SmartPart editor.
If you need to change the value of V_COT, you have to apply the value to the variable, like this:
V_COT = STR ( your_numeric_value , 1 , 2 )
So, you get your value with 2 decimals.

And, please, use modern image format like JPG or PNG as attached image. Then, we don't need to download the file, but it can be open directly in the web browser. Gracias.


Good morning Bertran.
First thank you for your help.
Apply the syntax that Nemo indicated to me, perhaps it is very simple, but it is difficult for me to make it work correctly, or understand how to apply it correctly on my part.
My reason is that I am making a text that would be the sum of two parameters HORIT+VERTI attached image 1.
In the Script 2D programming I make a variable called V_COT = (VERTI+HORIT) image 2, which I will use to put that value in image 3..
I understand the syntax concept, which Nemo told me, but I don't know how to apply it.
image 4, I apply str (1.234,4,2) , but when I run the 2D Script it complains.
Thanks in advance for your dedicated time.
Thanks.

Adjuntos (2)

Type: image/jpeg
Descargado 15 veces
Size: 88,87 KiB
Type: image/jpeg
Descargado 25 veces
Size: 67,44 KiB

Hola Toni,

Do only this:

V_COT = STR ( VERTI + HORIT , 1 , 2 )

When Nemo wrote "STR ( 1.234 , 4 , 2 )", the value "1.234" was the number to convert into string.
If you read the help on the bottom of the SmartPart editor, you can see how the syntax works.


Good afternoon Bertrand.
Thank you very much for your help,
Sincerely.


https://connect.allplan.com/ utiliza cookies  -  Aqui

Acéptalo