rounding length values
rounding length values
(OP)
Guys,
I know there have been a couple threads discussing how to deal with the round function in Catia, but I'm confused how to effectively use it.
Let's say I have a value: "length" = 50.225mm
How do I round this to:
(a) no significant digits (ie: 50mm)
(b) 1 significant digit (ie: 50.2mm)
(c) 2 significant digits (ie: 50.23mm)
I haven't been able to figure out the combination of code to get Catia to do this for me yet; I'd really appreciate it if someone can help on this.
Thanks
I know there have been a couple threads discussing how to deal with the round function in Catia, but I'm confused how to effectively use it.
Let's say I have a value: "length" = 50.225mm
How do I round this to:
(a) no significant digits (ie: 50mm)
(b) 1 significant digit (ie: 50.2mm)
(c) 2 significant digits (ie: 50.23mm)
I haven't been able to figure out the combination of code to get Catia to do this for me yet; I'd really appreciate it if someone can help on this.
Thanks





RE: rounding length values
RE: rounding length values
Basically dimesnions are rounded to even numbers, so your 50.225 would be 50.22 as 2 significant digits.
The explainations is that by always going to even numbers, it reduces tolerance build-up, as some numbers go up and some go down.
"Wildfires are dangerous, hard to control, and economically catastrophic."
Ben Loosli
Sr IS Technologist
L-3 Communications
RE: rounding length values
My example of "length" = 50.225mm was an example of a parameter in Part Design.
Being able to use Round with length parameters could enable some powerful knowledge-based part design functionality.
RE: rounding length values
RE: rounding length values
try this
if "Lenght" is a lenght paramater and the value is 50.225mm
the round() command needs a real paramater as input. By divide 1mm you convert the lenght to a real.
a) (round("Lenght"/1mm))*1mm should give 50mm
b) (round("Lenght" /1mm*10))*1mm/10 should give 50.2mm
c) (round("Lenght" /1mm*100))*1mm/100 should give 50.23mm
RE: rounding length values
Thank you very much! Your suggestion worked perfectly. I gave you a star in return :)
RE: rounding length values
I just used search "round" and found Eng-Tips : 124350
indocti discant et ament meminisse periti
RE: rounding length values