3dlogix
Mechanical
- Jan 31, 2002
- 435
Sometimes you need to pull a Real Number value and mix it with a Text value to create a string. Example, you have a Family table for pipe lengths.
With ProE Parameters, you can't mix real numbers with text, unless they are converted using itos (integer to string), and then it rounds up.
Here's a simple approach to this problem.
*******************************************************
You want to create a parameter that shows the length with annotation, such as "4.75 LONG" and put this in a drawing format.
Create a Parameter such as L=d1 (real number)
Create a Parameter such as L1=floor(L) (real number)
Create a Parameter such as L2=(L-L1)*1000 (real number)
Create a Parameter such as LENGTH=itos(L1) + "." + itos(L2) +"LONG"
Ex:
If d1=6.750
then L=6.750
L1=floor(6.750) = 6
L2=(6.750-6)*1000 = 750
LENGTH=itos(6) . itos(750) LONG = 6.750 LONG
With ProE Parameters, you can't mix real numbers with text, unless they are converted using itos (integer to string), and then it rounds up.
Here's a simple approach to this problem.
*******************************************************
You want to create a parameter that shows the length with annotation, such as "4.75 LONG" and put this in a drawing format.
Create a Parameter such as L=d1 (real number)
Create a Parameter such as L1=floor(L) (real number)
Create a Parameter such as L2=(L-L1)*1000 (real number)
Create a Parameter such as LENGTH=itos(L1) + "." + itos(L2) +"LONG"
Ex:
If d1=6.750
then L=6.750
L1=floor(6.750) = 6
L2=(6.750-6)*1000 = 750
LENGTH=itos(6) . itos(750) LONG = 6.750 LONG