Labeling and expression : Validating if there's an "Null" value in one of the field in expression

Labeling and expression : Validating if there's an "Null" value in one of the field in expression

cyberflow
Advisor Advisor
503 Views
4 Replies
Message 1 of 5

Labeling and expression : Validating if there's an "Null" value in one of the field in expression

cyberflow
Advisor
Advisor

Hi all,

Here's a tricky question : I'm in the process of minimizing the number of styles in our template.

And for profiles in a profile view we've got 2 type of label : Sag and Crest curve.

We want to have one single nice label that covers it all.

We've noticed that :

When using the High point or Low point elevation or station, it returns a null value when there's not one of them.

I want to validate if it's a null well i want my text height to be at 0 : 

In a crest : 

cyberflow_0-1720033617740.png

In a SAG : 

cyberflow_1-1720033645215.png

 



I did notice the same issue when tweaking my styles for the asymetric curve it returns null variables.
But i've mitigate that by using the substraction in the stations for the start, mid(PIV) and end of the curve. (Trying to adapt and overcome)

Now i'm trying to validate of to catch that null value.

Anyone knows if this is possible ?

TIA all 🙂 

Frank Freitas

CAE/CAD/BIM Coordinator & Support Specialist

LinkedIn
0 Likes
Accepted solutions (2)
504 Views
4 Replies
Replies (4)
Message 2 of 5

MMcCall402
Mentor
Mentor
Accepted solution

I use a couple Line components as object to anchor the text components to within the label style to get the behavior of labelling a HP when it has one or a LP when it has one, and nothing when it has neither.  The Line components anchor one end to the HP, or LP, on the curve and the other end to where I want the text to be. The visibility of these lines are set to False as I just need them to be there to anchor to, when they're there. <-- 'When they're there' is the key to this working.  When a curve doesn't have a HP then the HP line has nothing to anchor to and isn't created. This leaves no object for the HP text to anchor to, so it isn't created either.  Same for the LP situation.

 

In the sample below I turned those lines on and gave them a color.

 

MMcCall402_0-1720037526010.png

 

Mark Mccall 
CAD Mangler


EESignature


VHB - Engineering, Inc.

0 Likes
Message 3 of 5

cyberflow
Advisor
Advisor

Hi @MMcCall402 ,

Really never thought of that one ! 
Excellent idea, but i feel like i'm close to succeding on this one : 

cyberflow_0-1720038757278.png



The text takes the angle of the line, is there any way for it to keep the angle of the view ?

Frank Freitas

CAE/CAD/BIM Coordinator & Support Specialist

LinkedIn
0 Likes
Message 4 of 5

MMcCall402
Mentor
Mentor
Accepted solution

For that I used a secondary line drawn vertically,  anchored to the first one, and then anchored the text to the second one.   Its a little convoluted but once its set up it just works forever.   (... to the point where you forget how you set it up in the first place.)

 

  

Mark Mccall 
CAD Mangler


EESignature


VHB - Engineering, Inc.

Message 5 of 5

cyberflow
Advisor
Advisor

Hi @MMcCall402 !

I did found that one by myself and started setting it up as we speak !

cyberflow_0-1720040159774.png



Thanx again for helping me leverage the power of labels !

Frank Freitas

CAE/CAD/BIM Coordinator & Support Specialist

LinkedIn
0 Likes