AnsweredAssumed Answered

ArcGIS Pro 2.0 set layer extent on MAP object

Question asked by roxana.urdea on Oct 3, 2017

Hi,

I have a Python script that does stuff and creates a feature class. I need that feature class as a layer in TOC and zoomed in.

 

I'm using this code for the output layer parameter:

 

"""   output_layer = arcpy.Parameter(
displayName='output_layer',
name='output_layer',
datatype="GPFeatureLayer",
parameterType='Derived',
direction='Output')
output_layer.symbology = LYR_template """

 

My problem is that I can't manage to ZOOM to that layer after it's displayed in TOC.

 

In ArcMAP to do that I usually set up the dataframe extend like this:

dataFrame = arcpy.mapping.ListDataFrames(currentDocument, "*")[0]
dataFrame.extent = """extent of the layer"""

Does anyone knows how to do this?

Thank you
Roxana

#####

Outcomes