×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Mixing TEXT and Real Numbers

Mixing TEXT and Real Numbers

Mixing TEXT and Real Numbers

(OP)
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

http://www.sprdesign.com
http://www.3dlogix.com

RE: Mixing TEXT and Real Numbers

(OP)
Add this to show the "zero" values after the decimeal.

L=d1
L1=floor(L)
L2=(L-L1)*1000
IF L2=0
THEN LENGTH=itos(L1) + ".000 LONG"
ELSE
THEN LENGTH=itos(L1) + "." + itos(L2) +"LONG"
ENDIF


http://www.sprdesign.com
http://www.3dlogix.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources