AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Writing Expressions

6 REPLIES 6
Reply
Message 1 of 7
JWCI
576 Views, 6 Replies

Writing Expressions

I'm very new to map, limited experience, looking to write an expression for a GPS object that will include Pt #, Northing, Easting, Elevation seperate lines of text, I can currently view one property text at a time, ie. Pt #, How can I edit the expression below to achieve a multiline expression with Pt,N,E,El. Any help would be greatly appreciated.

CONCAT ( CONCAT ( CONCAT ( [property], '\n' ), 'Label: ' ), [property] )

Greg M.
6 REPLIES 6
Message 2 of 7
tjmapper
in reply to: JWCI

CONCAT( CONCAT( CONCAT (CONCAT (CONCAT (CONCAT ( "PT" , '\n'), "N" ), '\n' ), "E" ), '\n'), "El" )

or if you want a Label in front of each

CONCAT( CONCAT( CONCAT( CONCAT( CONCAT( CONCAT( CONCAT (CONCAT (CONCAT (CONCAT ( 'Pt# - ' , "Pt"), '\n'), 'Northing - '), "N" ), '\n'), 'Easting - '), "E" ), '\n'), 'Elevation - '), "El" ), '\n'),


I pray there is a simpler way, but that is how i would know to do it.

The first 'CONCAT' works for the first set of '()' but after that you will need a 'CONCAT' for each desired property or label. The '\n' tells it to go to the next line which also requires its own 'CONCAT'.

I hope someone can show us a simpler way. Figured this stuff out through tutorials so open to any suggestions.
Message 3 of 7
Anonymous
in reply to: JWCI


Concat ( Concat ( Concat (  Pt# , '\n'
),  Concat ( Northing, '\n' )   ),  Concat ( Concat (
Easting, '\n' ) , Elevation)    )


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I'm
very new to map, limited experience, looking to write an expression for a GPS
object that will include Pt #, Northing, Easting, Elevation seperate lines of
text, I can currently view one property text at a time, ie. Pt #, How can I
edit the expression below to achieve a multiline expression with Pt,N,E,El.
Any help would be greatly appreciated. CONCAT ( CONCAT ( CONCAT ( [property],
'\n' ), 'Label: ' ), [property] ) Greg M.
Message 4 of 7
Anonymous
in reply to: JWCI

I have a similar situation. I tried to plug in the code from both of the above suggestions and neither got the desired results. This is what is written in the advanced tab as a result of the expression I "built".

concat("FIELD1", concat("FIELD2", concat("FIELD3", "FIELD4")))

What should this read in order to get the contents of each field on it's own line?

Thanks,
Sam
Message 5 of 7
randyspear6624
in reply to: Anonymous

I just get a single line label with this expression... any ideas what i'm doing wrong?

CONCAT (  CONCAT (  Name , '\n',  AreaX  ) , '\n',  C  ) 

Message 6 of 7

Hi,

 

>> any ideas what i'm doing wrong?

Does it not work? Do you get a message (or where is the cursor when it tells you that there is a syntax error, a screenshot might be great)?

It's hard for us to guess, we don't see the data you have ... so e.g. if  your C is a field in the datasource or your just wamt to have the character "C" as prefix.

Is AreaX as field with double values or string values (if it's a double value then try to convert it to string before concatening it).

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 7 of 7
kajar
in reply to: Alfred.NESWADBA

There is no need to use multiple CONCAT functions in one expression, just one:

CONCAT(Northing, '\n', Easting, '\n', Pt) and thats it, you got three line text.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost