From the course: Learning ArcGIS Python Scripting
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Writing a script that uses ArcPy - ArcGIS Pro Tutorial
From the course: Learning ArcGIS Python Scripting
Writing a script that uses ArcPy
- [Instructor] Let's see how to write a script that uses this arcpy.mp module. First, we'll write a script to access an ArcGIS Pro project, and then we'll add to it to get one of the maps in the project and look at its properties. To get to a project, you have to create the project object. It starts like this. The ArcPy site package has an mp module, and the mp module has an ArcGISProject method. The method takes the fully qualified filename of the project as input. The ArcGISProject method creates the project object, which you need to grab hold of in a variable. So you import ArcPy and then use arcpy.mp.ArcGISProject to create the object. So this object, again, it's an open connection to the project, so now you can get to everything in that project and you store that object as a variable. For the rest of the script, instead of referring to the project by its actual name, you refer to it by its object name, that variable that you created. The project name is just a text string, so it…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Object-oriented programming (OOP) overview5m 41s
-
(Locked)
Incorporating Python libraries in a script5m 7s
-
(Locked)
The ArcPy library3m 51s
-
(Locked)
Writing a script that uses ArcPy5m 1s
-
(Locked)
ArcPy objects, properties, and methods2m 38s
-
(Locked)
Geoprocessing with Python and ArcPy5m 34s
-
(Locked)
Model builder for jump-starting your script5m 4s
-
(Locked)
The ArcGIS API for Python library: Getting to web GIS7m
-
(Locked)
-
-
-
-
-