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
Solved! Go to Solution.
Solved by Eduardo.Soethe. Go to Solution.
Solved by troma. Go to Solution.
Are you trying to plug a result of -1 in as a text height?
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
Rather than try to add text in the expression, you can add text to the label style.
Hi.
Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn
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 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
Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
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
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.
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
Yes, there is a solution, as stated
Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
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
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
Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
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
Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn
Adriano Oliveira
Diretor Soluções BIM MaxiCAD
MaxiCAD Soluções e Educação BIM.
Facebook | Twitter | LinkedIn
Hello Adriano,
Could post a drawing for us to look at? That might help us bridge our language difference.
Best regards,
Tim
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
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
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