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: 

custom labels

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
246 Views, 6 Replies

custom labels

Is there a way to change the color of a label based on its value? For
instance, can I make a slope label appear as red if the slope is greater
than 2.0%, green otherwise?

Thanks,
Jason
6 REPLIES 6
Message 2 of 7
dana.probert
in reply to: Anonymous

you can do a trick where it changes if it is negative. i think peter funk posted a trick with surface labels that are red or green depending on cut vs fill

but i have tried a bunch of other crazy tricks to get things like my VC indicator labels to do exactly what you describe with an IF statement and no luck.
Dana Probert, P.E.
Technical Marketing Manager, Civil Engineering
Autodesk
Blog: BIM on the Rocks
Learn More About BIM for Infrastructure
Message 3 of 7
Anonymous
in reply to: Anonymous

The trick is to use two labels one red and the other green at the same
location. Then if the value is positive show green and hide red, if neg show
red and hide green. In both cases, print out just the slope and not the +
or - sign.

For the 2% rule, you will have to check if the value is less than 2 percent
and return postive otherwise return neg.

If that's not enough, let me know and I'll break it down more...

Peter Funk
Autodesk, Inc.
Message 4 of 7
Anonymous
in reply to: Anonymous

I appreciate the reply, but I'm not familiar with how to go about doing
that. A little bit more info would be helpful - I probably don't need
you to spell it out. Where does one put the criteria to check the slope
values?

Thanks!
Message 5 of 7
dana.probert
in reply to: Anonymous

Here is a post with my little label in it (without the IF statement)
http://www.civil3d.com/index.php/2006/09/label-expressions-as-design-tools-for-vertical-curves/

and here are some more ideas
http://www.civil3d.com/index.php/2007/01/road-design-notes-june-2004-vs-january-2007/

http://civil3drocks.blogspot.com/2006/08/using-expression-to-make-decimalized.html

http://civil3drocks.blogspot.com/2006/08/using-expressions-and-references-to.html
Hopefully that will get you started.
Dana Probert, P.E.
Technical Marketing Manager, Civil Engineering
Autodesk
Blog: BIM on the Rocks
Learn More About BIM for Infrastructure
Message 6 of 7
Anonymous
in reply to: Anonymous

> http://civil3drocks.blogspot.com/2006/08/using-expressions-and-references-to.html

That helps, but I'm stuck...

I created two expressions:
IF({Surface Slope}<-0.02, {Surface Slope}*100, 0) <-- green
IF({Surface Slope}>=-0.02, {Surface Slope}*100, 0) <-- red

Then I stuck them into the label as two different components - the first
as green, the second as red. The problem is, the output of the IF
statement is 0 if the condition does not apply, so I have the correctly
colored slope overlaid with a 0.00 of the other color.

Is there any way to have IF return NULL for the false condition?

Thanks!
Message 7 of 7
Anonymous
in reply to: Anonymous

Nevermind, I figured it out. I set the function to return the ABS value
of the slope on a true condition, and -1 on a false condition, then the
label hide negative values.

Thanks for your help, and may the turtle continue to guide you.

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report