Hi there
When I import survey data, sometimes my manholes have depth information and sometimes they don't.
I have a label style for manholes that show the lid level, the depth to invert and the invert level. This works well for manholes with depth information.
I have tried to create an expression that changes the text height of the depth and invert level to zero if the depth is zero or null.
IF(Point.Depth=0,0,0.0025) works for depths of zero but not null
IF(Point.Depth>0.001,0.0025,0) works for depths of zero but not null
IF(Point.Depth>0,0.0025,0) works for depths of zero but not null
How can I get an expression to work on a null value?
Cheers
I don't have a dataset to test with, but did you try using ! ?
IF(!Point.Depth,0.0025)
I didn't see any built-in functions for Null and I am not sure what (if any) scripting language they are using.
Just a stab at it...
Mike
IF(Point.Depth=' ',0,0.0025)
IF(Point.Depth=" ",0,0.0025)
IF(Point.Depth= ,0,0.0025)
A few more to try.
John Mayo
John, are you saying those worked or didn't work?
I did not test anything. Just came up with a few ways for the OP to test that might check for the null value...
John Mayo
IF(!Point.Depth,0.0025) - this produces an error when saving the expression "wrong number of arguments"
IF(Point.Depth=' ',0,0.0025) when saving the expression this produces an error 'parse error, undefined symbol ''
IF(Point.Depth=" ",0,0.0025) when saving the expression this produces an error 'parse error, undefined symbol "'
IF(Point.Depth= ,0,0.0025 )when saving the expression this produces an error 'parse error, unexpected ,, expecting name, function, number, (, +, -, or !'
make depth and invert seperate components
If(depth = 0 ,-1, <text height>)
if (depth =0,1,<text height>)
and hide negative values in the composer
Sorry, I left out a param.
IF(!Point.Depth,0,0.0025)
It will compile but I don't have any dataset to test it with.
Regards,
Mike
IF(!Point.Depth,0,0.0025) - Like other options I've tried it only works when the depth is 0 not NULL.
This issue has been ecsallated to Autodesk Support so hopefully they can come up with something, maybe 2016?
Thanks for your input.
Hi HorizonalCurveGuy
I'm not sure how these are supposed to work
If(depth = 0 ,-1, <text height>)
if (depth =0,1,<text height>)
as my depth does not equal 0, it is NULL or no value.
Cheers
Caleb,
Did you ever get a response or resolution from Autodesk Support? I too need a function that will equal null.
Thanks,
Miguel
Unfortunatly no solution as yet. But please post here if you find one.
Cheers
Your Name
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.
Your Name
NULL is for a measurement of the depth to the invert. So for example when I survey the location of a manhole lid, but I do not record the depth to invert as well.
Your Name
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.
Your Name
I think I might have posted in the wrong location.
What I am looking for is a way for the expression to return nothing. Like in lisp you can set a variable to nil. I am not looking for null. I should have paid more attention.
All I wanted to do is setup an expression for labeling an alignment that would know when it is the end of the alignment and not place a station there. I can get it to identify the end of the alignment, but all I can do is set it to 0. This displays 0+00. I know I can just delete that last station after it's put in, but I want the label style to do it automaticly.
Thanks,
Miguel
Hi loretom
When I say null, I mean nothing at all, and empty data cell. So our queries may well be related. Civil3D does not appear to be able to recognise empty data fields in expressions.
Joe - Just to clarify, I'm not using 'structures' in Civil3D, just cogo points. I guess a invert of 0 could be interpreted as null or no value. But I don't want to have to enter 0 for every manhole I survey if I am not concerned with invert levels, I just want to be able to leave the field blank and be able
get an expression to recognise this.
Cheers
Your Name
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.
Your Name
Another instance of needing to check for NULL (not 0) values in an expression is if a surface spot elevation is outside of the surface the elevation value is NULL (not 0). If an expression could test for NULL values then the text height could be set to something not visible when it's outside of the surface extents instead of showing ??? as the elevation value.
Tom Richardson
CAD Manager
Crossing the line with Civil 3D
Twitter | LinkedIn
If you find an answer to your question, please mark Accept as Solution so others can find it...
Tom Richardson
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.
Autodesk Certified Professional in Civil 3D for Infrastructure Design
AutoCAD Certified Professional
------------------------------------
Autodesk AEC Community Blog
Crossing the line with Civil 3D
Twitter | LinkedIn
------------------------------------
Austin CAD User Group Resources
Blog | Discord | LinkedIn