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.

Quotes in relation text strings

jaybat12

New member
How do I show " in a text string as part of a relation? Ex: I want to show a pipe description by combining some parameters with some text strings.


To show


PIPE,
 
Create a parameter in the parameter list and enter the quote forit's value and insertthe parameterinto your description relation.
 
You can use ' (single quote) instead of " in relation when you need to use " (double quote or inch symbol) as text.


i.e. DESCRIPTION = 'PIPE,
 
I was using 2 single quotes together but they don't show up properly in a BOM. they look more like this 2`` than like this 2"
 
What I meant was to use single quotes to enclose your text.


i.e. TEXT = '2"' (single quote, 2, double quote, single quote)


not TEXT = "2''" (double quote, 2,single quote, single quote, double quote)


Charles
 
Ive got a similar problem...Im trying to use the show the
height x width x thickness in a description. i can get the
height and width but Im having problems getting it to show
"15 x 12 x .5". When I put the x in it shows an error. How
exactly are the quote marks suppose to be used in this
case?
 
You can't add a numerical value to a text string without
first converting the numerical value to text using the ITOS
command.
 
Can I not add text to a real number parameter?I can get 15
12 .5 to come up in the description. I just cant seem to
get "x".
 
Combining real numbers and strings gets complicated. You
do have to convert the real numbers to text first using
ITSO. Below is what I use for a plate. HOR, VERT and
LENGTH are dimension names of the plate. W1, H1 and L1
are temporary values for the code. I use IF statements to
get the correct number of characters based on whether the
value has a tens place or a hundreds place. INCH is a
string parameter I added and assigned the value "

IF HOR < 1
W1= "."+EXTRACT(ITOS(HOR*100),1,2)
ELSE
IF HOR< 10
W1=EXTRACT(ITOS(HOR*100),1,1)+"."+EXTRACT(ITOS(HOR*100),2
,2)
ELSE
W1=EXTRACT(ITOS(HOR*100),1,2)+"."+EXTRACT(ITOS(HOR*100),3
,2)
ENDIF
ENDIF

IF VERT < 1
H1= "."+EXTRACT(ITOS(VERT*100),1,2)
ELSE
IF VERT < 10
H1=EXTRACT(ITOS(VERT*100),1,1)+"."+EXTRACT(ITOS(VERT*100)
,2,2)
ELSE
H1=EXTRACT(ITOS(VERT*100),1,2)+"."+EXTRACT(ITOS(VERT*100)
,3,2)
ENDIF
ENDIF

IF LENGTH < 1
L1= "."+EXTRACT(ITOS(LENGTH*100),1,2)
ELSE
IF LENGTH < 10
L1=EXTRACT(ITOS(LENGTH*100),1,1)+"."+EXTRACT(ITOS(LENGTH*
100),2,2)
ELSE
IF LENGTH >= 100
L1=EXTRACT(ITOS(LENGTH*100),1,3)+"."+EXTRACT(ITOS(LENGTH*
100),4,2)
ELSE
L1=EXTRACT(ITOS(LENGTH*100),1,2)+"."+EXTRACT(ITOS(LENGTH*
100),3,2)
ENDIF
ENDIF
ENDIF

DESCRIPTION= "PLATE, " +W1+INCH+" X "+H1+INCH+" X
"+L1+INCH+"LG"
 
It does not include leading zeroes, which are not necessary
when specifying English dimensions. If you need a leading
zero you can change the second line of the Length if
statement to

L1= "0."+EXTRACT(ITOS(LENGTH*100),1,2)
 

Sponsor

Articles From 3DCAD World

Back
Top