See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Adding TEXT to an Expression

  1. #1
    Member
    Join Date
    2021-11
    Posts
    3
    Login to Give a bone
    0

    Default Adding TEXT to an Expression

    Dear All

    need help regarding the below issue.
    ===========================

    I am new to Civil 3D.
    want to create an expression in ( Alignment ----Label Styles-----Point of Intersection.)

    Expression with IF statement, should return a text " LEFT " when statement true else " RIGHT"... See image attached.

    Image01.jpg

  2. #2
    AUGI Addict
    Join Date
    2015-12
    Location
    Arizona
    Posts
    2,478
    Login to Give a bone
    0

    Default Re: Adding TEXT to an Expression

    So what part, if any of your current Expression works, or fails to work?

    From what I see your statement would not work as written.


    What is the goal of the label? are you after the deflection between alignments?

    What I get when I duplicate your Expression as shown is a PARSE Error undefined symbol "LEFT"

    A quick bit of research indicates one can NOT have an Expression return a TEXT Value.

    So this may not be a thing you can do in this way.


    Back the the question; What are you attempting to do with this label?
    Show me a 'fake' version with just text and an explanation.

    There may be another solution.
    Last edited by mjfarrell; 2021-11-26 at 02:07 PM.

  3. #3
    Member
    Join Date
    2021-11
    Posts
    3
    Login to Give a bone
    0

    Default Re: Adding TEXT to an Expression

    Quote Originally Posted by mjfarrell View Post
    So what part, if any of your current Expression works, or fails to work?

    From what I see your statement would not work as written.


    What is the goal of the label? are you after the deflection between alignments?

    What I get when I duplicate your Expression as shown is a PARSE Error undefined symbol "LEFT"

    A quick bit of research indicates one can NOT have an Expression return a TEXT Value.

    So this may not be a thing you can do in this way.


    Back the the question; What are you attempting to do with this label?
    Show me a 'fake' version with just text and an explanation.

    There may be another solution.
    Dear mjfarrell thanks for your reply.

    Dear my goal is to make a lebl for alignment at IP" Intersection points " which tells me the direction of deflection . that is Right (R) or Left (L) form tangent point.

    see attached picture for better understanding.
    Leftt turn.JPG
    Right turn.JPG

  4. #4
    AUGI Addict
    Join Date
    2015-12
    Location
    Arizona
    Posts
    2,478
    Login to Give a bone
    0

    Default Re: Adding TEXT to an Expression

    Did you add those "LEFT" and "RIGHT" annotations manually?
    What does that I= represent, and what is it being calculated against?
    Or is that a label style you have seen?

    The label shown looks like a standard Statioon and Offset Labelstat_offset_Elevation02.PNG

    I don't know that one can get this from a PI lable it looks like it might be possible from a Curve label, because the options
    within the expression generator include Angle In and Angle out, however it is still not going to generate a Left or Right direction output.

  5. #5
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,105
    Login to Give a bone
    0

    Default Re: Adding TEXT to an Expression

    If the L and R are automatically placed in the label, you might look into the drawing's settings. There is an Abbreviations tab which has a setting for labeling Left and Right, with each being initially set to the first letter of each direction. You could add the T at the end there to see if it helps.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  6. #6
    AUGI Addict
    Join Date
    2015-12
    Location
    Arizona
    Posts
    2,478
    Login to Give a bone
    0

    Default Re: Adding TEXT to an Expression

    Opie,

    From what I can tell the OP wants to label the deflection direction at a PI point even if/when there is no curve.
    A curve PI point will return a station and offset from the alignment.

    I can't seem to get a deflection direction as "LEFT" or "RIGHT" for a PI point because that isn't an option within an expression, it wont return
    a TEXT output. I'm not seeing anyway to add this automatically as part of an alignment label set.

    Now, it might be a case of evaluating the deflection, testing the angle and then returing a nemeric value to apply a size
    to a fixed piece of text that then displays too small to read LEFT when the deflection should be RIGHT
    and another piece of text that hides the RIGHT text value when the deflection angle is equal to a LEFT hand change in direction.

  7. #7
    Civil Engineering Moderator MHultgren's Avatar
    Join Date
    2000-12
    Location
    Indy West (Not West Indies)
    Posts
    1,446
    Login to Give a bone
    0

    Default Re: Adding TEXT to an Expression

    Did you try formatting the result as a String in the dropdown at the bottom?

    Depending on what your positive direction is set to (clockwise/counterclockwise) you should be able to evaluate the deflection angle and if it is positive or negative (or if it greater than or less than 180 degrees), output the appropriate string (LEFT or RIGHT).

  8. #8
    AUGI Addict
    Join Date
    2015-12
    Location
    Arizona
    Posts
    2,478
    Login to Give a bone
    0

    Default Re: Adding TEXT to an Expression

    Mark, I'm not so sure it can do that, even if formatting the output as 'STRING' (?)

    Do you have an example that does?

  9. #9
    Member
    Join Date
    2021-11
    Posts
    3
    Login to Give a bone
    0

    Default Re: Adding TEXT to an Expression

    Quote Originally Posted by mjfarrell View Post
    Did you add those "LEFT" and "RIGHT" annotations manually?
    What does that I= represent, and what is it being calculated against?
    Or is that a label style you have seen?

    The label shown looks like a standard Statioon and Offset Labelstat_offset_Elevation02.PNG

    I don't know that one can get this from a PI lable it looks like it might be possible from a Curve label, because the options
    within the expression generator include Angle In and Angle out, however it is still not going to generate a Left or Right direction output.
    Dear MJFARRELL can you share the label of image you attached.

    - - - Updated - - -

    Quote Originally Posted by MHultgren View Post
    Did you try formatting the result as a String in the dropdown at the bottom?

    Depending on what your positive direction is set to (clockwise/counterclockwise) you should be able to evaluate the deflection angle and if it is positive or negative (or if it greater than or less than 180 degrees), output the appropriate string (LEFT or RIGHT).
    Dear MHultgren ... I am unable to find STRING option in dropdown, can you help me in this regard.

  10. #10
    AUGI Addict
    Join Date
    2015-12
    Location
    Arizona
    Posts
    2,478
    Login to Give a bone
    0

    Default Re: Adding TEXT to an Expression

    From HELP:

    Format Result As
    Specifies how the expression results are formatted.

    Double: This value is formatted using the Unitless type.
    Note
    The following are all of type Double but are formatted according to the settings on the Ambient Settings tab in the Drawing settings:

    Angle
    Area
    Coordinate
    Dimension
    Direction
    Distance
    Elevation
    Grade/Slope
    Latitude
    Longitude
    Station
    Volume

    I'm pretty sure "STRING" is not an option, if it is I would like to see an example.


    The lable is a fairly standard Station and Offset Label

    STA <[Station Value(Uft|FS|P2|RN|AP|Sn|TP|B2|EN|W0|OF)]>
    N=<[Northing(Uft|P2|RN|AP|GC|UN|Sn|OF)]>
    E=<[Easting(Uft|P4|RN|AP|GC|UN|Sn|OF)]>
    I=<[Offset(Uft|P0|RN|AP|GC|UN|SD|OF)]>' <[Station Offset Side(CP)]>

Page 1 of 2 12 LastLast

Similar Threads

  1. 2020: Civil 3d Text Component editor label expression codes
    By KODA in forum AutoCAD Civil 3D - General
    Replies: 0
    Last Post: 2021-04-05, 09:01 PM
  2. Rtext expression
    By BCrouse in forum AutoLISP
    Replies: 2
    Last Post: 2005-05-25, 04:35 PM
  3. What's wrong in code? Get Field Expression Tool
    By danderson.71652 in forum VBA/COM Interop
    Replies: 4
    Last Post: 2005-01-05, 07:57 PM
  4. Appending to an expression in annotation template
    By JeremiahM in forum AutoCAD Map 3D - General
    Replies: 9
    Last Post: 2004-07-26, 05:01 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •