AnsweredAssumed Answered

How to concatenate 'str' and 'int' objects with python

Question asked by Andrew.N on Jun 6, 2016
Latest reply on Jun 6, 2016 by Andrew.N

Hi All,

 

I'm trying in a GDB using Arc10.2 to run a field calculate, into a text field using: "!SHAPE.firstpoint.X! &" "& !SHAPE.firstpoint.Y!" (without quotes) but this gives an error: 00539

  • cannot concatenate 'str' and 'int' objects

What would be the correct syntax?

I believe I need to cast but not sure how.

So far my workaround is to create a StartX and StartY field then combine them into another field StartXY, but this can be time consuming with a large number of records. There should be a better way.

 

!SHAPE.firstpoint.X! = 534792.9044

!SHAPE.firstpoint.Y! = 6917050.0155

End result should look like this:

534792.9044 6917050.0155

 

Cheers

 

Outcomes