ArcSDE/Oracle connection management from Python
I am a user with non-admin rights on a versioned ArcSDE Oracle geodatabase. I am writing a Python 2.6 script, and running it in ArcGIS 10.0 SP4. The script opens a connection from an .SDE file. I need...
View ArticleLabeling works in 10, but not 10.1
I have a python script which at one point adds a new set of features, symbolizes, and labels them. In 10 everything works correctly, but when I run the script in 10.1, the labels are lost even though...
View ArticlePython script for mass find and replace of workspace path?
Hi folks, As our research group has run out of space on a network drive, our IT department just moved all of our folders/data to a new network drive. However, in doing this all of the folder structures...
View Articlechange variable values to None by iterating list...
Hello, I have a script that I run as a tool, so many of the variables come in as "GetParameterAsText". I'm using many of these variables to update rows in a feature class, and I'm having a little bit...
View ArticleARC 10.0 CADToGeodatabase() syntax to write to existing FC in existing group...
I want to write geometry data (polylines,polygons,polygons with holes) from a dgn CADfile to a specific Featureclass under a specific group dataset (group layer). The FGDB is an empty template, I don't...
View ArticleStripping Text in Field Calculator using wildcard
Is there anyway to strip text using wild card... As in: HITCH ENTERPRISES, INC. WARRANTY DEED BOOK 552, PAGE 532 (NW/4) (NE/4) (SE/4) OUT OF SECTION 29 TOWNSHIP 1N RANGE 16E TEXAS COUNTY, OKLAHOMA...
View ArticlePython called from batch file --> geoprocessing logs
Hi all, I am calling a number of Python scripts from a batch file like below (simplified) SET PATH=%PATH%;D:\apps\Python27\ArcGIS10.1 SET PYSCRIPT="D:\Projects\MyTestScript.py" python %PYSCRIPT%and...
View ArticleDefine precision of Number to Text in Python
Greetings, I am attempting to calc a LAT and LONG that is in DD to new fields that are DMS. I have the python below that does the trick however I cannot define the precision of the Seconds. So the...
View Articleadd data from a list using "row.setValue" to a field
Hi, Using a script I get a list of values​​, which I need to add a field using "row.Setvalue" but I have not been successful. I hope you can help me! thanks GHJ Code: import arcpy import glob, os...
View Articledetermining the right geographic transformation for a Project_management()
Hi all, I have a script that opens a user-specified MXD and processes user-specified layers in it. Part of the processing involves projecting the data from whatever GCS it's in, to whatever PCS the...
View ArticleMultiple rasters to .lyr
Hello: I'm trying to make a .lyr file to bring into ArcMap with arcpy.mapping. I can bring a single raster into a .lyr with the script below. I'm unsure how to proceed to get multiple rasters from the...
View ArticleFieldInfo fails when using SpatialJoin
I am trying to do a point-in-polygon overlay using SpatialJoin and at the same time suppress most of the fields and rename the ones I want to keep. Theoretically all possible with a layer and a...
View Articlegetting the specified geographic transformation, or at least the GCS, of a...
Hi all, I have a script that opens a user-specified MXD and processes user-specified layers in it. Part of the processing involves projecting the data from whatever GCS it's in, to whatever PCS the...
View ArticlePythonaddins script edit
I have created an AddIn using pythonaddins. But when I edit python script for that addin and re-create '.esriaddin' file, I don't get updated results using that. Do I need to re-create AddIn each time...
View Articlemakefeaturelayer in selection use AND statement
I have export makefeature layer in model builder to python arcpy.MakeFeatureLayer_management("l_GBKN_mut", "l_GBKN_mut_layer", "\"LKICODE\" = v_object AND \"PRECISIE\" =v_precisie", "",) And afcourse...
View ArticleGA Layer to Points loop
Hello All and thank you in advance for your assistance! I've got some python code for the GA Layer to Points function: # Import system modules import arcpy # Set local variables inLayer =...
View ArticleLaunch Python script on mxd open?
We are upgrading/migrating to a new SDE server, leaving my organization with probably thousands of .mxds with datasource references pointing to the old, soon to go away, server. I could write a py...
View ArticleDraw a rectangle by dragging
Hi Experts How can I draw a rectangle on my map by clicking and dragging my cursor click using python codes? Best Regards Babak
View ArticleEnable ArcMap Tool by python codes
How can I enable Select Features tool using python codes? Something like Code: SelectFeatures.enable = True I am not sure that it is correct but it must be something like this Regards Babak
View ArticleHow to save output files in a folder created within python Add-In?
Output folder is defined during execution of python Add-In and it is required that output should be stored in the created folder. But I am getting an error pertaining to output folder string such as...
View Article