How to set parameter on this export map in Python script

297
0
03-15-2021 10:03 PM
Labels (3)
cinnaaaoo
New Contributor II

I want to create a python script that takes a map as an image. I uploaded it to the service, but I tried uploading it to the service, but it didn't raise the parameter

How should this code be fixed?

import arcpy, os
import ConversionUtils

msgWorkspace = ConversionUtils.gp.GetIDMessage(86127)
msgSuccess = ConversionUtils.gp.GetIDMessage(86128)
msgFail = ConversionUtils.gp.GetIDMessage(86129)
msgConverting = ConversionUtils.gp.GetIDMessage(86130)

outWorkspace = ConversionUtils.gp.GetParameterAsText(0)

aprx = arcpy.mp.ArcGISProject("CURRENT")
mv = aprx.activeView

ext = mv.camera.getExtent()
mv.panToExtent(ext)
mv.zoomToAllLayers()
mv.camera.setExtent(ext)
Output_File = os.path.join(outWorkspace, 'ActiveMapView.png')
mv.exportToPNG(Output_File, width=1000, height=1000)

0 Kudos
0 Replies