|
POST
|
I am attempting to complete an exercise in chapter 11 of the book "Python Scripting for ArcGIS Pro". One of the example code bits i'm trying to run is this: import arcpy aprx = arcpy.mp.ArcGISProject(r"C:\Users\shildebr\Documents\PythonScripting_Ex11_Data\Ex11\Austin.aprx") print(aprx.defaultGeodatabase) When I run this I get this message: File "H:/EsriTraining/Python Scripting for ArcGIS Pro/PythonScripting_Ex11_Data/Ex11/projects.py", line 2, in <module> aprx = arcpy.mp.ArcGISProject(r"C:\Users\shildebr\Documents\PythonScripting_Ex11_Data\Ex11\Austin.aprx") AttributeError: 'module' object has no attribute 'mp' Isn't "defaultGeodatabase" a property of the ArcGISProject object? I'm really confused as to why this won't run.
... View more
04-27-2021
03:01 PM
|
0
|
7
|
14164
|
|
POST
|
Thanks Scott, I only have the layer I want to edit checked in the editing controls pane. I only have the parcels and sub basins (the layer i'm trying to edit) selected in the snapping controls pane. Here are the warnings I have with my layers, but "being projected on the fly" shouldn't have any effect on this? Below is a screenshot showing what happens when I start to trace. Notice that it seems to snap to the gravity main line in the middle of the street, but not to the parcel line that i'm trying to trace. The gravity main layer is unchecked in the snapping controls. Any help would be greatly appreciated!
... View more
04-02-2020
07:39 AM
|
0
|
3
|
10646
|
|
POST
|
Has anyone had any problems getting the trace tool to actually trace features? I have a layer of parcels that I want to trace and a layer of subdivisions that I want to create by tracing parcels. Usually you just click the layer you want to trace and it starts tracing. Anyone else having similar problems The two layers are selectable and both have snapping enabled, but nothing traces once you start tracing. Any ideas or troubleshooting steps out there?
... View more
04-01-2020
02:33 PM
|
4
|
21
|
14799
|
|
POST
|
Does anyone know if there is a way to create annotation from the labels of a specific layer and "store them in the map" like we could do in arcmap? It looks like you can only convert the labels for everything in the map but not a specific layer. I would like to just create annotation for a small area and be able to move it around like text in a layout.
... View more
03-24-2020
08:17 AM
|
1
|
0
|
614
|
|
POST
|
Our IT department ran a scan on PyScripter using Virus Total and it McAfee-GW-Edition threw a red flag, so they deemed it as malicious. Are there any third-party ide's out there that might be "safer" to use?
... View more
01-30-2020
08:54 AM
|
0
|
1
|
8422
|
|
POST
|
Does anyone have any recommendations for best python IDE's that are compatible with ArcGIS? I'm looking for something that has line numbers and good debugging tools. Something better than the default IDLE program that is installed already with ArcGIS. We thought that PyScripter would be a good option, but it appears that it is a malicious program. I appreciate any direction you can provide.
... View more
01-30-2020
07:29 AM
|
1
|
10
|
9396
|
|
POST
|
Yeah that's essentially what i'm trying to do except I don't want to create a new feature class. I want the result of the spatial join to populate the existing point feature class.
... View more
12-04-2019
09:46 AM
|
0
|
1
|
1649
|
|
POST
|
I am trying to automate a process to populate a field in a point feature class with the name of district (a polygon layer) that it falls inside using python. Ideally this script would only populate the points that have NULL district names. I'm thinking this may be done programmatically using the select by attribute, select by location, and calculate field functions? If someone could point me in the right direction, that would be much appreciated!
... View more
12-02-2019
02:25 PM
|
0
|
4
|
1741
|
|
POST
|
Thanks Alberto for your help. I was able to create a variable that concatenates the full path to the newly created geodatabase name import arcpy from arcpy import env import arcpy.da as da import os # Process: Delete Features From Daily File arcpy.TruncateTable_management(r"W:\Projects\KansasCityMO\Valve And Hydrant\Data\Databases\KCMO_Daily_File.gdb\Valve") arcpy.TruncateTable_management(r"W:\Projects\KansasCityMO\Valve And Hydrant\Data\Databases\KCMO_Daily_File.gdb\Hydrant") # Script arguments workspace = arcpy.GetParameterAsText(0) # workspace folder containing exported .mdb's outValveFC = arcpy.GetParameterAsText(1) # output valve feature class outHydrantFC = arcpy.GetParameterAsText(2) # output hydrant feature class spRef = arcpy.GetParameterAsText(3) # output coordinate system # Set the current workspace arcpy.env.workspace = workspace # Create .gdb to Hold Combined Valve & Hydrant Data arcpy.CreateFileGDB_management(workspace, "KCMO_Workspace_2019.gdb") fileGDB = os.path.join(workspace, "KCMO_Workspace_2019.gdb") # List all personal geodatabase tables in the current workspace and export to filegdb workspaces = arcpy.ListWorkspaces("*", "ACCESS") for dailyFolder in workspaces: arcpy.env.workspace = dailyFolder tables = set(arcpy.ListTables("Valve") + arcpy.ListTables("Cannot_Locate_Valve") + arcpy.ListTables("Shutdown_Valve") + arcpy.ListTables("Hydrant") + arcpy.ListTables("CNL_Hydrant")) for table in tables: arcpy.TableToGeodatabase_conversion(table, fileGDB)
... View more
08-30-2019
12:27 PM
|
0
|
2
|
3383
|
|
POST
|
Thanks Alberto, Any thoughts as to why I get this error when using any of those?: TypeError: unsupported operand type(s) for +: 'Result' and 'str' import arcpy from arcpy import env import arcpy.da as da import os # Set Workspace workspace = r"W:\Projects\KansasCityMO\Valve And Hydrant\Data\PFdata\Export\2019\0819\0813" # Create .mdb to Hold Combined Valve & Hydrant Data target_geodatabase = arcpy.CreateFileGDB_management(workspace, "CombinedData.gdb") # Load Schema arcpy.ImportXMLWorkspaceDocument_management (target_geodatabase, r"W:\Projects\KansasCityMO\Valve And Hydrant\Data\Databases\KCMO_DAILY_FILE.xml", "SCHEMA_ONLY") # Set the current workspace arcpy.env.workspace = workspace # List all personal geodatabase tables in the current workspace and append to Daily_Valve table workspaces = arcpy.ListWorkspaces("*", "ACCESS") for workspace in workspaces: arcpy.env.workspace = workspace tables = set(arcpy.ListTables("Valve") + arcpy.ListTables("Cannot_Locate_Valve")) for table in tables: arcpy.Append_management(table, target_geodatabase + "\\Daily_Valve", "NO_TEST")
... View more
08-22-2019
08:51 AM
|
0
|
6
|
3383
|
|
POST
|
Thanks Alberto, Do you know how to reference the target table that was created earlier in the script when the xml document was imported? Without referencing the direct path (since a new empty table with a different path will be created every time the script is run). I'm thinking something like: target_geodatabase + "Daily_Valve" or os.path.join(target_geodatabase, "Daily_Valve")
... View more
08-21-2019
01:44 PM
|
0
|
8
|
3383
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-10-2025 06:55 AM | |
| 1 | 03-13-2025 08:00 AM | |
| 1 | 02-03-2025 07:35 AM | |
| 1 | 11-25-2024 10:06 AM | |
| 1 | 08-07-2024 11:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-05-2026
06:35 AM
|