Setting workspace to SDE feature dataset
I have a python add-in that successfully edits data in a file .gdb (with or without invoking the editor in the script), but I can't edit data in an SDE feature dataset. I can edit the SDE data (9.3)...
View ArticleSort_management in for loop
Hello, I like to convert tables (100+) living in access database to a geodatabase table, sorting them and deleting unnecessary fields in each table at the same time. I figured I use the Sort_management...
View ArticleClarifying when cursor locks are released
Does the following line of code "release" the cursor? Code: #Note: rdsmall_lyr has a single selected feature rdsmall_values = sorted(arcpy.da.SearchCursor(rdsmall_lyr, ["UA", "FAID_S", "CTCODE",...
View ArticleNeeding PDFs created, Exported to 2 different locations
I have my python code written. IT actually works. I just don't know how to code the pdfPath to 2 different locations. Please help with code. Code: import arcpy, os folderPath = r"K:\TASS\2 - GEO-DATA...
View Articlefaster script for making polygon from points
I am just curious if any one has any ideas on how this may perform faster as some of these tables can get quite large and at the rate I am going it is not looking good: about 700 recs/hr 1) I have an...
View ArticleLyr to Group Lyr automation
Hi All, I have hundreds of .lyr files in "sets of two" within the same folder. Within each of these sets is a polygon layer of a district boundary and a points layer containing relevant locations...
View ArticleExecuteError in append command
I'm trying to append several shapefiles together. I adapted an example script from http://help.arcgis.com/en/arcgisdesk...l#//0013000000, but it's not working. Moreover, the error code is completely...
View Articlemxd.saveACopy changes layout to portrait
I have developed a script that loops through all MXDs in a given directory, stores relative paths and then saves it as ArcGIS 9.x compatible. At firts I thought it was working as expected. But I just...
View ArticleHow to add filter for topo features variable?
Hi everyone! I'm trying to create a filter in Validator updateParameters() for my topo features variable. I figured out how to set value using list of lists: self.params[0].value = [[1, 2, 3], [4, 5,...
View ArticleAdd Features to Terrain
I'm trying to write a script that adds two polygon features to a terrain using variable names, however I keep getting the following error. ExecuteError: Failed to execute. Parameters are not valid....
View ArticleDescribe method for ObjectID
I know how to use describe method when there is an FID field in layer's attribute table. I use the following codes Code: # describe the feature layer to access the the selected set desc =...
View ArticlePython-Addin On/Off-button
Hello, is it possible to build an on/off-button in a toolbar, that activates a different toolbar. I tried the following snippet: Code: class ButtonClass5(object): """Implementation for...
View ArticlePython Add-In problems
Hi everybody, I was just watching the introduction to Desktop Add-Ins using Python and was trying to create the exact same add-in shown in the video. I can't find any flaws in the code I have written...
View Articlewhat is 'port binding error'?
I try opening Python shell and get this message and I don't understand the instructions it gives me.
View ArticleUsing Update Cursor in For Loop - error
I am trying to use an update cursor ina for loop and I keep getting an IOError that I don't understand. The script is looping through my table, selecting records one by one, then doing a select by...
View ArticleUndo/Redo Python AddIn edits on SDE feature classes?
I have a Python AddIn that edits SDE feature classes. I’d like to have the option to Undo/Redo edits made with the AddIn. So far I’ve tried several approaches (below), and am wondering if anybody can...
View ArticleBest way to obfuscate python code?
Hi, what is the best way to prevent someone from reading and editing python code? I tried py2exe, pyinstaller and cx_freeze to create an executable. I got the executables, but they don't run. I also...
View ArticleASCIIToRaster_conversion not working
Dear all here is my syntax Code: import arcpy import os dir_name = "J:/BIOCLIM_Data/a1b_scenario/csiro_mk3_0_sres_a1b_2020s_bio_30s_no_tile_asc" for filename in os.listdir(dir_name): if not...
View ArticleEOL in 10.1
Hey folks, I was running into a eol error when calculating a field with string values that have carriage returns. The statement I was using was: Code: !field_name! My work around was as follows: Code:...
View ArticleAdd/Calculate Field within a python script
Hi all, I am trying to build a tool in python that selects by location, copy to new feature class, add a field to the new feature class, and calculate the field that was just added in the script. The...
View Article