import arcpy import os, sys from xml.etree import cElementTree as ElementTree def addCoreFields(fc): arcpy.AddField_management(fc, "AssetObjectId", "LONG", "", "", "", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "AssetId", "LONG", "", "", "", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "AssetObjectStatus", "TEXT", "", "", "32", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "Status", "TEXT", "", "", "32", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "Feature", "TEXT", "", "", "32", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "SubFeature", "TEXT", "", "", "32", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "AssetCode", "TEXT", "", "", "32", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "LaneLocation", "TEXT", "", "", "32", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "Route", "TEXT", "", "", "32", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "FromMilepost", "LONG", "", "", "", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "FromOffset", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "ToMilepost", "LONG", "", "", "", "", "NULLABLE", "NON_REQUIRED", "") arcpy.AddField_management(fc, "ToOffset", "DOUBLE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "") if __name__ == '__main__': scriptPath = sys.path[0] dataGDB = os.path.join(scriptPath, "data.gdb") if arcpy.Exists(dataGDB): arcpy.Delete_management(dataGDB) arcpy.CreateFileGDB_management(scriptPath, "data") sr = "PROJCS['NAD_1983_StatePlane_Arizona_Central_FIPS_0202_Feet_Intl',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',700000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-111.9166666666667],PARAMETER['Scale_Factor',0.9999],PARAMETER['Latitude_Of_Origin',31.0],UNIT['Foot',0.3048]];-17746700 -44067300 3048;-100000 10000;-100000 10000;3.28083989501312E-03;0.001;0.001;IsHighPrecision" for name in ['one', 'two', 'three']: fc = os.path.join(dataGDB, name) arcpy.CreateFeatureclass_management(dataGDB, name, "POINT", "", "DISABLED", "DISABLED", sr, "", "0", "0", "0") addCoreFields(fc)
Solved! Go to Solution.
arcpy.AddField_management(fc, "AssetObjectId", "LONG") #instead of arcpy.AddField_management(fc, "AssetObjectId", "LONG", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")Is it possible to temporarily disable Forfront, and at least determine that doing so fixes the issue? Maybe your IT people will make an exception for you... mine did for me.
#Process: Adds the neccessary fields arcpy.AddField_management(indxTileFC, "REMSOFT_ID", "LONG"); showGpMessage() #calcs this field in the post-process arcpy.AddField_management(indxTileFC, "ACCBUFF", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "ADMIN_NM", "TEXT", "", "", "20"); showGpMessage() arcpy.AddField_management(indxTileFC, "COUNTY_NM", "TEXT", "", "", "20"); showGpMessage() arcpy.AddField_management(indxTileFC, "CLASS_RPT", "TEXT", "", "", "8"); showGpMessage() arcpy.AddField_management(indxTileFC, "CLASS_MODL", "TEXT", "", "", "8"); showGpMessage() arcpy.AddField_management(indxTileFC, "DEFER_RSNS", "TEXT", "", "", "60"); showGpMessage() arcpy.AddField_management(indxTileFC, "DEFER_YR", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "DFR_YR_MDL", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "DEM_ELV", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "DEM_SLP", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "DISTRCT_NM", "TEXT", "", "", "20"); showGpMessage() arcpy.AddField_management(indxTileFC, "EAGLES", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "FORESTED", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "HCPLND_FLG", "SHORT"); showGpMessage() #added 20120827 arcpy.AddField_management(indxTileFC, "HCPUNIT_NM", "TEXT", "", "", "20"); showGpMessage() arcpy.AddField_management(indxTileFC, "ITERATION", "TEXT", "", "", "18"); showGpMessage() #edit made for Rod to QC arcpy.AddField_management(indxTileFC, "LANDCOV_CD", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "LANDUSE_CD", "TEXT", "", "", "12"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_NW_ID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_PC_ID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_SPS_ID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_E_FLG", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_F_FLG", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_I_FLG", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_S_FLG", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_DF_YR", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_RP_FLG", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "LCL_UP_FLG", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "LPU_CD", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "LPU_NM", "TEXT", "", "", "30"); showGpMessage() arcpy.AddField_management(indxTileFC, "LSMS_RIP", "TEXT", "", "", "12"); showGpMessage() arcpy.AddField_management(indxTileFC, "LSMS_UP", "TEXT", "", "", "12"); showGpMessage() arcpy.AddField_management(indxTileFC, "LYNX_OID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "MGMT_FUND", "TEXT", "", "", "4"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_INT_OID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_MA_OID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_MA_NM", "TEXT", "", "", "50"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_PLN_OID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_PLN_LBL", "TEXT", "", "", "50"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_PLN_STA", "TEXT", "", "", "18"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_POL_OID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_POL_LBL", "TEXT", "", "", "50"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_POL_STA", "TEXT", "", "", "18"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_SWA_OID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_SWA_TNM", "TEXT", "", "", "50"); showGpMessage() arcpy.AddField_management(indxTileFC, "MM_SWA_RSN", "TEXT", "", "", "75"); showGpMessage() arcpy.AddField_management(indxTileFC, "NRF_DISP_O", "TEXT", "", "", "8"); showGpMessage() arcpy.AddField_management(indxTileFC, "NSO_FH_OID", "LONG"); showGpMessage() #Future habitat areas arcpy.AddField_management(indxTileFC, "NSO_KC_OID", "LONG"); showGpMessage() #Kilickitat Core arcpy.AddField_management(indxTileFC, "NSO_KH_OID", "LONG"); showGpMessage() #Klickitat Habitat arcpy.AddField_management(indxTileFC, "NSO_MGT_CD", "TEXT", "", "", "3"); showGpMessage() arcpy.AddField_management(indxTileFC, "NSO_MGT_CS", "TEXT", "", "", "21"); showGpMessage() arcpy.AddField_management(indxTileFC, "NSO_MGT_AR", "TEXT", "", "", "8"); showGpMessage() arcpy.AddField_management(indxTileFC, "NSOMGT_OID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "NSO_NESTP", "TEXT", "", "", "4"); showGpMessage() arcpy.AddField_management(indxTileFC, "O_CMZ_TY", "TEXT", "", "", "2"); showGpMessage() #OESF CMZ buffer type (i or e) arcpy.AddField_management(indxTileFC, "O_CMZ_WTY", "SHORT"); showGpMessage() #OESF CMZ water type arcpy.AddField_management(indxTileFC, "O_OC_DIST", "LONG"); showGpMessage() #OESF distance to ocean (saltwater) arcpy.AddField_management(indxTileFC, "O_RB_DIST", "SHORT"); showGpMessage() #OESF riparian buffer distance arcpy.AddField_management(indxTileFC, "O_RB_OID", "LONG"); showGpMessage() #OESF riparian buffer objectid arcpy.AddField_management(indxTileFC, "O_RB_WTY", "SHORT"); showGpMessage() #OESF riparian buffer water type arcpy.AddField_management(indxTileFC, "O_SWS_ID", "SHORT"); showGpMessage() #OESF subwatershed identified arcpy.AddField_management(indxTileFC, "O_SWS_PCT", "FLOAT"); showGpMessage() #OESF percent of subwatershed in DNR's forested managment arcpy.AddField_management(indxTileFC, "O_SWS_UAC", "FLOAT"); showGpMessage() #OESF subwatershed upland acres (no saltwater) arcpy.AddField_management(indxTileFC, "O_UNST_SRC", "SHORT"); showGpMessage() #OESF unstable slope data source arcpy.AddField_management(indxTileFC, "O_UNST_TY", "TEXT", "", "", "2"); showGpMessage() #OESF unstable slope type (i or e) arcpy.AddField_management(indxTileFC, "O_UNST_WTY", "SHORT"); showGpMessage() #OESF unstable slope water type arcpy.AddField_management(indxTileFC, "O_WET_TY", "TEXT", "", "", "2"); showGpMessage() #OESF wetland type (i or e) arcpy.AddField_management(indxTileFC, "OWLS_1R", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "OWLS_1R_E", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "OWLS_M1", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "OWLS_SW", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "PARCEL_ID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "PEREGRINES", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "PLS_OID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "PLS_SEC_NM", "TEXT", "", "", "20"); showGpMessage() arcpy.AddField_management(indxTileFC, "PLS_TWNRNG", "TEXT", "", "", "8"); showGpMessage() arcpy.AddField_management(indxTileFC, "REGION_NM", "TEXT", "", "", "20"); showGpMessage() arcpy.AddField_management(indxTileFC, "RIU_CUR_ID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "RIU_MST_ID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "RMU_POLYID", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "ROAD_BUFF", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "ROAD_DIST", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "ROS", "TEXT", "", "", "8"); showGpMessage() arcpy.AddField_management(indxTileFC, "ROS_ZN_CD", "TEXT", "", "", "2"); showGpMessage() arcpy.AddField_management(indxTileFC, "SHU_NM", "TEXT", "", "", "12"); showGpMessage() #added 20120905, csny490 - same as OWNGROUP field arcpy.AddField_management(indxTileFC, "SLPSTB_AC", "FLOAT"); showGpMessage() arcpy.AddField_management(indxTileFC, "SOMU_CD", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "SOMU_NM", "TEXT", "", "", "30"); showGpMessage() arcpy.AddField_management(indxTileFC, "SOMU_PCT", "FLOAT"); showGpMessage() arcpy.AddField_management(indxTileFC, "SUB_CD", "TEXT", "", "", "8"); showGpMessage() arcpy.AddField_management(indxTileFC, "SUB_NO", "LONG"); showGpMessage() arcpy.AddField_management(indxTileFC, "SUB_PCT", "FLOAT"); showGpMessage() arcpy.AddField_management(indxTileFC, "SUB_UP_AC", "FLOAT"); showGpMessage() arcpy.AddField_management(indxTileFC, "SUR_OWN_CD", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "SUR_OWN_NM", "TEXT", "", "", "50"); showGpMessage() arcpy.AddField_management(indxTileFC, "TIM_OWN_CD", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "TIM_OWN_NM", "TEXT", "", "", "50"); showGpMessage() arcpy.AddField_management(indxTileFC, "WOGHI_INDX", "FLOAT"); showGpMessage() arcpy.AddField_management(indxTileFC, "WRIA_CD", "SHORT"); showGpMessage() arcpy.AddField_management(indxTileFC, "WRIA_NM", "TEXT", "", "", "30"); showGpMessage() arcpy.AddField_management(indxTileFC, "XACT_TY", "TEXT", "", "", "2"); showGpMessage() arcpy.AddField_management(indxTileFC, "XACT_OID", "LONG"); showGpMessage()