replaceDataSource
I have mxd i work on for different cases, but have the the same layers. The script i am working on needs to update the "Subject_Property" layer data source. I am having trouble getting this to work....
View ArticlePython addin correctly installed but not shown under the tolbars
Hello, I wrote some python-addin toolbars and installed them. They work correctly on different computers. But on one computer with Windows XP they will install correctly, but not shown under the...
View ArticleQuestion regarding populating a field in model builder with either Python or VB
I'm looking to populate a field using the calculate tool in model builder. To populate the column within my table I want to use a series of if, then statements so the model accurately assigns the...
View ArticleProgrammically Populate Value List in ArcGIS Tool Interface
I'm just trying to set up the parameters in a tool I've built in ArcGIS. What I want to do is read in a feature class or table and get the values in a specific field called "SITE". The field contains a...
View ArticleVBA to Python - Exit application without saving document
Hi, I found VBA code to remove the prompt to save in ArcMap, however, it appears as though i can't access the VBA (even though i appear to have it installed...i can't find the Tools menu anywhere). So...
View ArticleSQL Expression help, Select_Analysis
In my code below, I am attempting to select features that have meet this Criteria : SNAP_FLAG (this is a field) < 3. Then I want to export these selected features as a new feature class. Code: #...
View Articleproblem using python modules
I have a rather basic python question re: modules I have a python script that's essentially structured as follows: ====================================== ## aaa.py func1(): ...some code......
View ArticleClipping a raster
I am accepting a polygon currently as a featureset, though that can change if it needs to, as input to a tool. In that tool, I need to clip a raster by this polygon. I cannot seem to get the...
View Articledesigning parameter text with composite data types
Hello, I would like to know if there is a chance to change the text that is written next to radiobutton in a python toolbox when I define a parameter with composite datatypes. I use string and double,...
View ArticleCreate a polygon shapefile
Hi, I have four points say a {51.646932,5.053536}, b{51.645907,5.051111} , c{51.644695,5.051283} and d{51.644735,5.055017} I am new to python and want to know how to create a polygon with the help of...
View ArticlePython script runs in 10 but not 10.1 - using .odc connection
I currently have a script that pulls information from a Microsoft SQL Server Table View and exports it to a file geodatabase using an .odc connection. This script will run fine in version 10.0, but...
View ArticlePublishing - Trying to write script that analyzes MXD, but doesn't publish...
Hi all, this is my first post so be gentle. At my office we have roughly 10,000 mxds that need to be transfered to a new server and then published. That being said we are constantly thinking of ways to...
View ArticleError with Feature Class to Shapefile in Python
I am trying to automate the conversion of several geodatabase feature classes to shapefile. The code below produces a shapefile in the output directory but then it throws this error.... Code: PYTHON...
View ArticleHow to Iterate over a list of fields and use an UpdataCursor to update the...
I have multiple feature class that I performed analysis on and for each field that starts with a "t*" and is type "Double". I need to use a UpdateCursor to update the values within each of the...
View ArticleSQL error when using Python call argument
Hi, The following code add two arguments to the Python call. The first argument works fine but the second gives an invalid SQL error when using SELECT. The script I have attached shows the parcel...
View ArticleSelect by attribute using a variable
Hi I have created the following script to select the biggest extent in the mapview using an select by attribute tool which must contain an expression for where clause. I have also followed other posts...
View ArticleSetting Data frame extent
Hello, I have a script which updates a layer in a mxd on disc and want to set the extent of the Data Frame to the new layer, so when the mxd is opened the new layer is centered in the frame. I have...
View ArticleSet Null value for raster datasets
Hi, I am writing a Python code to automate a process. In it I need to use SetNull function several times to extracting the required values from the raster dataset. I am using the following line of...
View ArticleImport arcpy modules into Jython
I have a 3rd party scheduling application that my company bought and would like me to try to use for my Python scripts, SQL tasks, jobs, etc. It appears to be Java based and although they claim it can...
View ArticleWill anything in "with arcpy.da.SearchCursor(fc,fields,'1=2') as cursor"...
Does a "with" block always execute even when passed an empty cursor? For testing purposes I've tried this: Code: with arcpy.da.SearchCursor(fc, "ST_ID", "1=2") as cursor: arcpy.AddMessage("In the...
View Article