expression that hides link grades that are -50% and +50% and show the rest of the top labels with text height of say 2mm

expression that hides link grades that are -50% and +50% and show the rest of the top labels with text height of say 2mm

oliverkisera
Collaborator Collaborator
429 Views
7 Replies
Message 1 of 8

expression that hides link grades that are -50% and +50% and show the rest of the top labels with text height of say 2mm

oliverkisera
Collaborator
Collaborator

Hello good people, I have set this link expression , IF({Link Grade}=0,0,0.002), in the settings tab, to hide link grades that are 0% and to show the rest of the remaining top links, Ive attached a pic showing some top links showing -50% and I want those to be hidden, Ive tried creating expression that I can combine with the above expression such that it hides grades of -50% and +50%, but displays the rest of the grades with text height of 2mm, in the pic Ive auploaded, theres -50% slope appearing next to -1:2 slope, which is controled by daylight link slope assigned in the corridor, Im terribly in need to hide this -50% slopes being displayed by the corridor top links, since I dont have the pkt files, this is my only hope, any suggestion of such an expression that can do for me this will be highly appreciated. Thanks in advance

0 Likes
Accepted solutions (2)
430 Views
7 Replies
Replies (7)
Message 2 of 8

oliverkisera
Collaborator
Collaborator

Ive tried using this expression, IF({Link Grade})=0.5,0,0.002), but its hiding all link labels including the top pave levels like -2.5%, and so on, I only need to hide -50% and +50% link labels

0 Likes
Message 3 of 8

essam-salah
Advisor
Advisor

IF( (ABS({Link Grade}) > 0.4999) & (ABS({Link Grade}) < 0.5001), 0, 0.1)

above is an expression for label text height not the label text composer.

Notes: 

- 0.4999 and 0.5001 is the bound of 0.5 of course you can increase precision,

-  0.1 is the label text height, you change it with the value you want.

essamsalah_0-1764361971112.png

 

essamsalah_1-1764362037596.png

 

0 Likes
Message 4 of 8

essam-salah
Advisor
Advisor
Accepted solution

@oliverkisera wrote:

Ive tried using this expression, IF({Link Grade})=0.5,0,0.002), but its hiding all link labels including the top pave levels like -2.5%, and so on, I only need to hide -50% and +50% link labels


this weird the expression you are using in common cases will not hide any thing if you're using it as label text height, the reason is grade=0.5 is rare since in computer floating point numbers like double/float,... usually has tiny extra fractions so 0.5 might be 0.4999999997 or smth like that. you need to use epsilon/precision value to compare

0 Likes
Message 5 of 8

oliverkisera
Collaborator
Collaborator

Great, and Thanks for helping know that some values wont be exactly -0.5, Ive used this and it has worked, now I have clean cross-section labels, Thanks a lot, here is the expression,

 

IF({Link Grade} <-0.498, 0, 0.002)

0 Likes
Message 6 of 8

essam-salah
Advisor
Advisor

@oliverkisera wrote:

Great, and Thanks for helping know that some values wont be exactly -0.5, Ive used this and it has worked, now I have clean cross-section labels, Thanks a lot, here is the expression,

 

IF({Link Grade} <-0.498, 0, 0.002)


glad it works

0 Likes
Message 7 of 8

oliverkisera
Collaborator
Collaborator

Hello, how can I modify this expression, to also hide links whose grades are 0%, Ive struggled with it and still not getting it right, any expression that would the magic will be highly appreciated., here is the expression, 

 

IF( (ABS({Link Grade}) > 0.4999) & (ABS({Link Grade}) < 0.5001), 0, 0.3), IF({Link Grade} <-0.498, 0, 0.002)

0 Likes
Message 8 of 8

essam-salah
Advisor
Advisor
Accepted solution

@oliverkisera wrote:

IF( (ABS({Link Grade}) > 0.4999) & (ABS({Link Grade}) < 0.5001), 0, 0.3), IF({Link Grade} <-0.498, 0, 0.002)


these are two if statements which will return two values separated by comma as wrote it, which is not a double valid value, so what you need to do is ORing the two if expressions in one if statement, anyway below is how to hide grades values: 0.5 or -0.5 or 0

IF( 
((ABS({Link Grade}) > 0.4999) & (ABS({Link Grade}) < 0.5001)) |
(ABS({Link Grade}) < 0.0001), 
0, 
0.03)

 

essamsalah_0-1764497400673.png

 

0 Likes