Solved

setAttribute Python Caller

  • 22 October 2021
  • 2 replies
  • 151 views

Badge +6

Hi,

I have a script that does an area calculation using arcpy, the two calculated areas are output in the log, I need each one of them to be output as an attribute, how to do this? I'm new to python at FME.

 

image 

log:

 

imageThe output, it doesn't help me at all.

 

image 

Thank you for your help

 

 

icon

Best answer by david_r 25 October 2021, 09:10

View original

2 replies

Userlevel 4

Any particular reason for using arcpy rather than the AreaCalculator transformer?

Other than that, you can add the following on line 124:

feature.setAttribute('total_xyz', total_xyz)
feature.setAttribute('total_TAL', total_TAL)

I've substituted the red "blob" for xyz above. You'll need to also expose the new attributes in the PythonCaller settings.

Badge +6

Any particular reason for using arcpy rather than the AreaCalculator transformer?

Other than that, you can add the following on line 124:

feature.setAttribute('total_xyz', total_xyz)
feature.setAttribute('total_TAL', total_TAL)

I've substituted the red "blob" for xyz above. You'll need to also expose the new attributes in the PythonCaller settings.

Hi @david_r​ 

 

Helped a lot. Thank´s 

 

This script is huge, I don't want to change its structure but, I would prefer to use the Area Calculator.

 

Thank´s

 

Reply