Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Description Includes Length Automatically

verge

New member
I want my description of certain parts to include the length as read directly from the model. Is there a way to setup my description parameter to automatically read the length from the part?


I've been playing around in Relations trying to make this work, but so far no luck. Even tried using Excel to edit my family table, but that Excel function won't work on the family table. I'm thinking I need to be in Relations to do this...
 
That worked perfectly!
smiley32.gif



Only one more minor detail - how do I control decimal places of the dimension? One part, for example, is 30.13 inches long, but the string value comes out as 30. Is there a way to keep those decimal places? They're important.


And thanks again
smiley4.gif
.
 
Well, I found a way to cheat my way around it for now.


I simply used: LENGTH=ITOS(d0*1000)


then placed a decimal in front of it in the relation for DESCRIPTION.


If anyone knows a more direct approach, that would be great, too.
smiley4.gif
 
I just realized that this only covers dimensions that are <1.


For those dimensions > 1, I used the technique in this thread.


[url]http://www.mcadcentral.com/proe/forum/forum_posts.asp?TID=21 573&KW=real+numbers+to+string [/url]


There is one small error in the solution. You'll need to add quotation marks around the decimal point as such:


(I'm quoting charleskim here, from back when he was a novice with only 311 posts
smiley36.gif
):


Below is an example of converting real number into string.
Where A1, B1, and C1 are temporary values.
L is dimension for length.

A1 = L
B1 = FLOOR(A1)
C1 = (A1-B1)*100
IF C1 == 0
LENGTH = ITOS(B1) + ".00"
ELSE
LENGTH = ITOS(B1) + "."+ ITOS(C1)
ENDIF



This works perfectly!
 

Sponsor

Articles From 3DCAD World

Back
Top