Solved

How to Load User Parameter Choices From a PythonCaller Loop Result

  • 30 November 2023
  • 2 replies
  • 28 views

I have a simple PythonCaller (for now) which basically is something like this

import fme
import fmeobjects
import arcpy
 
class FeatureProcessor(object):
    def __init__(self):
        """Base constructor for class members."""
        pass
 
    def input(self, feature):
        
        geom = ["Point", "Multipoint", "Polyline", "Polygon","Envelope"]
        for geo in geom:
          print(geo) 
 
        self.pyoutput(feature)
 
    def close(self):
        pass
 
    def process_group(self):
        pass

Can you please let me know 

1- Pass the Result of Python  from PythonCaller to User Parameter Choices 

 

image 

2- How to Pass selected values from here to second PythonCaller2 to only simply print out the selected choice?

 

I tried to make it as simple as possible and sorry for confusion!

 

icon

Best answer by david_r 30 November 2023, 09:30

View original

2 replies

Userlevel 3
Badge +17

Hi @bhk​ ,

Unfortunately there is no way to configure a user parameter at run time dynamically, you will have to configure the parameter when you create the workspace. 

Userlevel 5

As mentioned by @Takashi Iijima​ , all parameters are read-only once the workspace has started.

To retrieve a user parameter in Python, use the fme.macroValues dictionary, e.g.

import fme
param_value = fme.macroValues.get('USER_PARAM_NAME', 'My default value')

See also this article: https://community.safe.com/s/article/python-and-fme-basics#Parameters

Reply