POST
|
Dan, I get the following error when I run you example. It errors on the fm.addInputField(input_shp,field.name) line. RuntimeError: FieldMap: Error in adding input field to field map
... View more
04-07-2015
04:01 AM
|
0
|
1
|
688
|
POST
|
Can anyone please tell me why this is not working? When I use the FeatureClassToFeatureClass_conversion geoprocessing tool, I do not want any of the existing fields to be in the output file. fldmap = arcpy.FieldMappings()
remfldmap = fldmap.removeAll()
arcpy.FeatureClassToFeatureClass_conversion(lyr,GDB,fc,"",remfldmap,"")
... View more
04-06-2015
01:05 PM
|
0
|
5
|
4775
|
POST
|
Try setting the data_frame parameter of the ExportToPDF function to "PAGE_LAYOUT". This will export the layout view in the mxd. If this parameter in not set it will default to the data frame. arcpy.mapping.ExportToPDF(mxd, dir + "\file.pdf", "PAGE_LAYOUT")
... View more
03-26-2015
07:35 AM
|
0
|
0
|
398
|
POST
|
I would try the arcpy.ListFeatureClasses() to get a list of shape file in folder. import os
import arcpy
# Set the workspace for ListFeatureClasses
dirpath = "C:/Users/Fred/Desktop/GIS/ModelBuilder Project/TEST"
arcpy.env.workspace = dirpath
# Use the ListFeatureClasses function to return a list of shapefiles.
featureclasses = arcpy.ListFeatureClasses()
# loop through the list of shape files
for ifc in featureclasses:
ofc = os.path.join(dirpath,os.path.splitext(ifc)[0] + "_Buffer.shp")
arcpy.Buffer_analysis(ifc,ofc,"1 Kilometer","FULL","ROUND","ALL","")
... View more
02-19-2015
09:10 AM
|
0
|
0
|
7262
|
Online Status |
Offline
|
Date Last Visited |
09-06-2023
06:37 AM
|