Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Include Text in Expression.

27 REPLIES 27
SOLVED
Reply
Message 1 of 28
Adriano_cad
4120 Views, 27 Replies

Include Text in Expression.

Include Text in Expression.

 

I need include one text in Expression for AutoCAD Civil 3D

My Expression: IF({Asymmetric Length 1}>1,({K Value}/{Profile Curve Length}*{Asymmetric Length 1}),-1)

I need this Expression: IF({Asymmetric Length 1}>1,(k1:{K Value}/{Profile Curve Length}*{Asymmetric Length 1}),-1)

K1 is Text for indicate the result for expression. I can not include this text in outside label because, while =-1, the label is invisible.



Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
27 REPLIES 27
Message 2 of 28
tcorey
in reply to: Adriano_cad

Are you trying to plug a result of -1 in as a text height?



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 3 of 28
Adriano_cad
in reply to: tcorey

No. The expression already does what I need. But I want the same expression I can have a text.



Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
Message 4 of 28
tcorey
in reply to: Adriano_cad

Rather than try to add text in the expression, you can add text to the label style.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 5 of 28
Adriano_cad
in reply to: tcorey

Hi.

 
Yes I know.
 
 But I need to make the text value K1 be invisible whenever the expression result is -1. So can not be included on the label, because if you stay in the label text value K1 will not be invisible.


Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
Message 6 of 28
tcorey
in reply to: Adriano_cad

Make two expressions. Make two components in your label style.

 

The expression that evaluates to -1 should return a positive value (text height) if true and 0 if false. Build your label component, adding the additonal text KB, and for Text Height, click the drop down list within Text Height and pick this expression.

 

The other expression should return positive if the result is not -1 and 0 if it is. Add another component to the label style, this time without the extra text KB. In the Text Height drop down, pick this expression.

 

Each expression will force a component to have a positive text height or 0.

 

 



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 7 of 28
Joe-Bouza
in reply to: Adriano_cad

Tim has it. You cannot have conditional strings, but you can have conditional expression to set the text height like the ubiquitous cut and fill labels that get bandied about here

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS
Message 8 of 28
Adriano_cad
in reply to: Joe-Bouza

Hello everyone.

The problem is as follows:

 

The expression rode doing what I need. But I need to include a label before the dynamic expression. Eg

 

If the expression result is positive then the label informs K1 = value of the expression.

 

If the expression result is negative then the label is not displayed.

 

The expression profile for curves:  IF({Asymmetric Length 1}>1,({K Value}/{Profile Curve Length}*{Asymmetric Length 1}),-1).

 

Thanks



Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
Message 9 of 28
BrianHailey
in reply to: Adriano_cad

As others have stated, an expression will ONLY return a number. You cannot get an expresson to return text in any way shape or form. Can't be done. No way to do it. Impossible.

 

The only workaround we currently have is to return a value for the height of the text. If the expression is true, return a valid height for the label component. If the expression is false, return a really really small height for the text. Now use that in the height field for the label component.

Brian J. Hailey, P.E.



GEI Consultants
My Civil 3D Blog

Message 10 of 28
Adriano_cad
in reply to: BrianHailey

Hello,

 

I already know that an expression can only return number. My appointment was for friends to see if some had already found a solution for this.

 

Thank you, all.



Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
Message 11 of 28
Joe-Bouza
in reply to: Adriano_cad

Yes, there is a solution, as stated

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS
Message 12 of 28
Adriano_cad
in reply to: Joe-Bouza

Hello

How are you?

Yes, your idea is ok.

I did so and it was good. I like to have a single expression for all.


When I wrote the words already knew he could not contain text, but I decided to take the opnion of all to see if anyone did.

Thanks.



Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
Message 13 of 28
Joe-Bouza
in reply to: Adriano_cad

Hello Adriano

 

I don't think so, because we have to use the condition for text heigh assignment you'll need an expression for both 

Thank you

Joseph D. Bouza, P.E. (one of 'THOSE' People)

HP Z210 Workstation
Intel Xeon CPU E31240 @ 3.30 Hz
12 GB Ram


Note: Its all Resistentialism, so keep calm and carry on

64 Bit Win10 OS
Message 14 of 28
Adriano_cad
in reply to: Joe-Bouza

Hello,

 

Exactly, that's what made an expression for each label, so the control was dynamic.

 

thank you

 



Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
Message 15 of 28
Adriano_cad
in reply to: tcorey

No. The expression already does what I need. But I want the same expression I can have a text -- *Adriano Oliveira* 51.9167-8397 adriano.cad@gmail.com / suporte@maxicad.com.br Authorized Author / Autodesk Authorized Instructor / Consultor de Aplica??o Pr?mio Instructor Quality Award pela Autodesk Inc Suporte MaxiCAD Inform?tica www.maxicad.com.br www.maxicad.com.br/blog http://br.linkedin.com/pub/adriano-oliveira/42/914/774


Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
Message 16 of 28
Adriano_cad
in reply to: tcorey

Hi. Yes I know. But I need to make the text value K1 be invisible whenever the expression result is -1. So can not be included on the label, because if you stay in the label text value K1 will not be invisible. -- *Adriano Oliveira* 51.9167-8397 adriano.cad@gmail.com / suporte@maxicad.com.br Authorized Author / Autodesk Authorized Instructor / Consultor de Aplica??o Pr?mio Instructor Quality Award pela Autodesk Inc Suporte MaxiCAD Inform?tica www.maxicad.com.br www.maxicad.com.br/blog http://br.linkedin.com/pub/adriano-oliveira/42/914/774


Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
Message 17 of 28
tcorey
in reply to: Adriano_cad

Hello Adriano,

 

Could post a drawing for us to look at? That might help us bridge our language difference.

 

Best regards,

 

Tim

 



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 18 of 28
Adriano_cad
in reply to: tcorey

Hello

 

I going send one drawing with situation.

 

Thanks

 

 



Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text
Message 19 of 28
troma
in reply to: Adriano_cad

I think you just need one expression.

It needs to be desgined to return a zero for the case where you don't want the text to display.

It needs to be desgined to return your text height for the case where you do want the text to display.

 

(NB text height in drawing units.  I found this out: if I want 1.5mm text, I would type 1.5 in the text height box.  But if you're using an expression to set the text height it's 0.0015, because it reads it as metres.)

 

As others have said, use this expression as the text height for the componant " K1=<xxx> "

The entire componant will disapear in the case when the text height is zero.

 

 

I don't know if you will need other expression to change the size of the border around the text.

 


Mark Green

Working on Civil 3D in Canada

Message 20 of 28
Adriano_cad
in reply to: troma

HI,

 

The equation works, but when the component is not located on the curve is the value? '. Do you have any idea how to hide?

 

Thanks



Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn


some text

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report