AutoCAD Civil 3D General Discussion

AutoCAD Civil 3D General Discussion

Reply
*Expert Elite*
Adriano_cad
Posts: 105
Registered: ‎06-21-2011
Message 1 of 22 (636 Views)
Accepted Solution

Include Text in Expression.

636 Views, 21 Replies
12-21-2012 06:17 AM

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

*Expert Elite*
MaxiCAD Informática
www.maxicad.com.br
*Expert Elite*
tcorey
Posts: 2,537
Registered: ‎12-18-2002
Message 2 of 22 (611 Views)

Re: Include Text in Expression.

12-21-2012 09:30 AM in reply to: Adriano_cad

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

Tim Corey, Owner
Delta Engineering Systems
Redding, CA
Autodesk Authorized Value-Added Reseller
*Expert Elite*
Adriano_cad
Posts: 105
Registered: ‎06-21-2011
Message 3 of 22 (610 Views)

Re: Include Text in Expression.

12-21-2012 09:35 AM 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

*Expert Elite*
MaxiCAD Informática
www.maxicad.com.br
*Expert Elite*
tcorey
Posts: 2,537
Registered: ‎12-18-2002
Message 4 of 22 (597 Views)

Re: Include Text in Expression.

12-21-2012 11:17 AM in reply to: Adriano_cad

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

Tim Corey, Owner
Delta Engineering Systems
Redding, CA
Autodesk Authorized Value-Added Reseller
*Expert Elite*
Adriano_cad
Posts: 105
Registered: ‎06-21-2011
Message 5 of 22 (595 Views)

Re: Include Text in Expression.

12-21-2012 11:46 AM 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

*Expert Elite*
MaxiCAD Informática
www.maxicad.com.br
*Expert Elite*
tcorey
Posts: 2,537
Registered: ‎12-18-2002
Message 6 of 22 (586 Views)

Re: Include Text in Expression.

12-21-2012 12:49 PM 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, Owner
Delta Engineering Systems
Redding, CA
Autodesk Authorized Value-Added Reseller
*Expert Elite*
Joe-Bouza
Posts: 4,873
Registered: ‎12-15-2008
Message 7 of 22 (581 Views)

Re: Include Text in Expression.

12-21-2012 02:22 PM 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) Civil 3D 2012 & 2013
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 Win7 OS
*Expert Elite*
Adriano_cad
Posts: 105
Registered: ‎06-21-2011
Message 8 of 22 (572 Views)

Re: Include Text in Expression.

12-21-2012 04:42 PM 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

*Expert Elite*
MaxiCAD Informática
www.maxicad.com.br
*Expert Elite*
BrianHailey
Posts: 2,768
Registered: ‎04-27-2005
Message 9 of 22 (554 Views)

Re: Include Text in Expression.

12-21-2012 08:01 PM 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 Hailey
CAD-1.com
My Blog
*Expert Elite*
Adriano_cad
Posts: 105
Registered: ‎06-21-2011
Message 10 of 22 (551 Views)

Re: Include Text in Expression.

12-21-2012 08:17 PM 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

*Expert Elite*
MaxiCAD Informática
www.maxicad.com.br
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.