This is the piece of code that is failing:
##nomenclatura = string '1.1.E.3.52'
##pdfOutput = output string
from qgis.core import QgsProject
project = QgsProject.instance()
QgsExpressionContextUtils.setProjectVariable(project,'Manzana_actual',nomenclatura)
tx = pScope.variable('Manzana_actual')
layer = project.instance().mapLayersByName('Mzs,Qt,Chs')[0]
iface.setActiveLayer(layer)
#continues#
ERROR MESSAGE:
QgsExpressionContextUtils.setProjectVariable(project,'Manzana_actual',nomenclatura)
NameError: name 'QgsExpressionContextUtils' is not defined
I copy pasted all the code in the python console and it works, but fails when I try to save it as a script...