• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD Civil 3D

    Reply
    *Expert Elite*
    Adriano_cad
    Posts: 60
    Registered: ‎06-21-2011
    Accepted Solution

    Include Text in Expression.

    424 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
    Please use plain text.
    *Expert Elite*
    Posts: 1,745
    Registered: ‎12-18-2002

    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
    Please use plain text.
    *Expert Elite*
    Adriano_cad
    Posts: 60
    Registered: ‎06-21-2011

    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
    Please use plain text.
    *Expert Elite*
    Posts: 1,745
    Registered: ‎12-18-2002

    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
    Please use plain text.
    *Expert Elite*
    Adriano_cad
    Posts: 60
    Registered: ‎06-21-2011

    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
    Please use plain text.
    *Expert Elite*
    Posts: 1,745
    Registered: ‎12-18-2002

    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
    Please use plain text.
    *Expert Elite*
    Joe-Bouza
    Posts: 3,311
    Registered: ‎12-15-2008

    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
    Please use plain text.
    *Expert Elite*
    Adriano_cad
    Posts: 60
    Registered: ‎06-21-2011

    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
    Please use plain text.
    *Expert Elite*
    BrianHailey
    Posts: 2,391
    Registered: ‎04-27-2005

    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.

    Please use plain text.
    *Expert Elite*
    Adriano_cad
    Posts: 60
    Registered: ‎06-21-2011

    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
    Please use plain text.