Skip to main content

I have a project wich produced a parameter I need in the shutdown python script. The problem is I cannot use it. Maybe I can but I don't know the protocole.

A solution would be to "send" the attribute into a published parameter and then use the published parameter into the python script.

But I dn't know how to do the "send" in this scenario.

Any ideas?

FYI : the attribute become a published parameter in a following workspace. Maybe I can catch it from there.

It is not possible to modify the contents of private or published parameters while the workspace is running.

A possible solution could be to use a PythonCaller in your workspace to store feature attributes in a global object (e.g. a list or a dictionary), then reference the same global object in your shutdown script.


Hi @slerendu, published/private user parameters are configured before starting translation and you cannot set/change them in the translation process unfortunately. A workaround is to define a Python global variable with a PythonCaller. The global variable can be used in Shutdown Pyhon script.


Hi @slerendu, published/private user parameters are configured before starting translation and you cannot set/change them in the translation process unfortunately. A workaround is to define a Python global variable with a PythonCaller. The global variable can be used in Shutdown Pyhon script.

wow, completely same as David's suggestion :)

 


Hi @slerendu, published/private user parameters are configured before starting translation and you cannot set/change them in the translation process unfortunately. A workaround is to define a Python global variable with a PythonCaller. The global variable can be used in Shutdown Pyhon script.

Example

 

# PythonCaller Script
def processFeature(feature):
    global value
    value = feature.getAttribute("attr")
# Shutdown Python Script
print value

It is not possible to modify the contents of private or published parameters while the workspace is running.

A possible solution could be to use a PythonCaller in your workspace to store feature attributes in a global object (e.g. a list or a dictionary), then reference the same global object in your shutdown script.

It works fine. Thanks both of you.

 

 


Hi @slerendu, published/private user parameters are configured before starting translation and you cannot set/change them in the translation process unfortunately. A workaround is to define a Python global variable with a PythonCaller. The global variable can be used in Shutdown Pyhon script.

It works fine. Thanks both of you.

 

 


Reply