Skip to main content

Using an old version - 2019.1.3.1 with ArcGIS 2.7 compatability.

 

In my script I have where:

 

import fme

import fmeobjects

 

 if __name__ == "__main__":

   # Script parameters

   inputLayer = feature.get.Attribute('inputLayer')

   outputLocation = feature.getAttribute('outputLocation')

   outputName = feature.getAttribute('outputName')

Sorry - the line

inputLayer = feature.get.Attribute('inputLayer')

 

is acually

inputLayer = feature.getAttribute('inputLayer')


You'll have to either use the expected method or the class interface, see https://community.safe.com/s/article/pythoncaller-transformer

 

Basically, your code should look something like:

import fme
import fmeobjects
 
def my_feature_processor(feature):
   # Script parameters
   inputLayer = feature.getAttribute('inputLayer')
   outputLocation = feature.getAttribute('outputLocation')
   outputName = feature.getAttribute('outputName')

You then have to tell the PythonCaller that your entry point is "my_feature_processor"


Thanks david_r,

That worked for me.


Reply