Hello, everyone!
I'm trying to build a new toolbox with one single python scrit to be shared internally. It's a simple script to help export layouts with our specified needs more easely.
That said, I have created a validation script for adding a filter to my layout parameter. The idea is that, first, the user will select the project were the layout are, and then the filter updates with all the layouts available inside that project.
It was succesfull when the project from which I wanted to export the layout was oppened. hower, when I tried running the script from a blank project, selecting one that I had worked on previously, the filter did not show. Is there a way to solve this?
Here's my code:
class ToolValidator(object😞
def __init__(self):
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
if self.params[0].altered:
project = self.params[0].value
aprx = arcpy.mp.ArcGISProject(project)
layouts_list = aprx.listLayouts()
self.params[1].filter.list = layouts_list
return
def updateParameters(self):
return
def updateMessages(self):
return