I exportado un modelo de model builder a python. Pero qgis:refactorfields no acepta @row_number como expresión.
outputs_QGISREFACTORFIELDS_1=processing.runalg('qgis:refactorfields', outputs_QGISMULTIPARTTOSINGLEPARTS_1['OUTPUT'],'[{'type': 2, 'length': 3, 'expression': u'@row_number', 'name': u'cluster', 'precision': 0}]',cluster)
SyntaxError: invalid syntax 1 Cannot find variable: row_number 2 Uncaught error while executing algorithm Traceback (most recent call last): File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 203, in execute self.processAlgorithm(progress) File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\script\ScriptAlgorithm.py", line 378, in processAlgorithm exec((script), ns) File "<string>", line 9
He probado con $row_num, pero no funciona.