I am trying to use an if expression in the style editor to label a feature with no success as yet.
Expression reads
if ( length ( name ) > 5, substr (name, ( instr ( name, '/' ) +1 ) , ( length ( name ) - instr ( name, "/" ) - 1 ) ) , name)
I keep getting type mismatch error.
Where name is a string and / is a character to search for in the string
Basically, I want to check if the label is longer than 5 characters. Using - if ( length ( name ) > 5,
and return the end of the name string that is after the character "/" Using - substr (name, ( instr ( name, '/' ) +1 ) , ( length ( name ) - instr ( name, "/" ) - 1 ) )
otherwise return the name.
Anyone have any ideas?
The if statement comes in as -- If ( [condition], [trueValue], [falseValue] )
So i think I am doing it correctly.
I have tried using just basic elements and still et the same results. I have searched the help and it doesn't mention the IF expression, as well as checking with google, this newsgroup and various blogs.
Using Civil 3d 2010 Map features using FDO to connect to data files.
If a post provides a fix for your issue, click on "Accept as Solution" to help other users find solutions to problems they might have that are similar to yours.
Andrew Puller
Maitland, NSW, Australia
Windows 10 Enterprise 64bit
Intel core i7 11800 @ 2.30 GHz with 32GB Ram
Civil 3d 2021