POST
|
How do I move a feature class into a feature dataset using ArcPy? I've tried both arcpy.CopyFeatures_management() and arcpy.Copy_management, which both give me these errors: ExecuteError: ERROR 000725: Output Feature Class: Dataset G:\GIS Data\xxxxxx\..._20180209 already exists. In this case, an empty feature dataset is created to store these feature classes. I just want to be able to move them into the datasets. I also just tried arcpy.FeatureClassToFeatureClass_conversion() with no success: ExecuteError: ERROR 999999: Error executing function. Failed to execute (FeatureClassToFeatureClass).
... View more
02-09-2018
07:00 AM
|
0
|
2
|
6936
|
POST
|
This doesn't seem to persist after ArcMap is closed; is this something that only works during that session?
... View more
01-12-2018
10:57 AM
|
0
|
2
|
2167
|
POST
|
Just what I was looking for, works perfectly! Thank you
... View more
01-12-2018
09:03 AM
|
0
|
0
|
2167
|
POST
|
For example, I have a custom tool "wellTabletoFC". When I pull up the Item Description, it gives me a syntax as if it can be used within the console: wellTabletoFC(Input_Table) When I drag the script into the Python window, I get this code: >>> arcpy.wellTabletoFC()
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'wellTabletoFC' How do I use my own tools in the same way as ArcGIS tools within ArcPy, for example: arcpy.Project_management(
in_dataset,
out_dataset,
out_coor_system,
transform_method,
{in_coor_system},
{preserve_shape},
{max_deviation},
{vertical}
)
I want to do this for 2 reasons: Run the tool within the Python console, while being able to return the tool output into a variable, Chain multiple custom tools together that are maintained separately, into a single workflow
... View more
01-12-2018
07:53 AM
|
0
|
6
|
3677
|
POST
|
ArcPy can be imported. I just realized my issue came from not restarting ArcMap after changing my script; even after reimporting my module (without restarting), it doesn't see the changes until I restart. It works now, and looks like import arcpy is required. Solution: make sure import arcpy is in the module, and restart ArcMap after any changes to the .py file import arcpy
def refresher():
''' Refreshes map and TOC '''
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
return 'Refreshed map and TOC.'
... View more
11-15-2017
07:17 AM
|
2
|
0
|
699
|
POST
|
No, I can't use this within the builtin python IDE in ArcGIS. I'd assume that arcpy was already loaded and ready for use after opening the program, but that's not the case when I remove the "import arcpy" line. It doesn't work whether I import arcpy or not within my module. Yes, I'm working in ArcMap 10.5 (py2), and no changes to conda.
... View more
11-15-2017
06:54 AM
|
0
|
2
|
699
|
POST
|
I'm trying to use the arcpy module in functions that are within custom Python modules that I've created, but I keep getting this error: NameError: global name 'arcpy' is not defined How do I fix this? These modules will be used within ArcGIS, where ArcPy is already loaded. I've tried with and without "import arcpy". Example: import arcpy
def refresher():
''' Refreshes map and TOC '''
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
return 'Refreshed map and TOC.'
... View more
11-15-2017
06:22 AM
|
0
|
4
|
908
|
POST
|
Thank you. While looking at this option, I realized that I could iterate my shapefiles through "Feature Class to Feature Class" in Python, and specify the field mappings there.
... View more
06-22-2017
07:07 AM
|
1
|
0
|
530
|
POST
|
I am trying to change field name, type, length, and precision during an import of multiple shapefiles, but unlike the "Feature Class to Feature Class" tool, there is no field mapping section for the "Feature Class to Geodatabase (multiple)" tool. Is there a way to do this using python?
... View more
06-21-2017
01:57 PM
|
0
|
2
|
959
|
Title | Kudos | Posted |
---|---|---|
2 | 11-15-2017 07:17 AM | |
1 | 06-22-2017 07:07 AM | |
1 | 02-09-2018 10:42 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|