POST
|
I did try that and as soon as I enter the new workspace location on my 😧 drive, and press OK, CE reboots and starts off from scratch.
... View more
02-09-2018
01:19 PM
|
0
|
1
|
727
|
POST
|
I think the problem is that my C: drive has been frozen by the school where I work, and CE wants to write things to the C: drive.
... View more
02-09-2018
10:11 AM
|
0
|
0
|
727
|
POST
|
With ArcGIS v10, when I selected to edit a py script in ArcMap my IDLE editor would open. Now in 10.1 when I select to edit my py script, I get NotePad. Can someone advise me how to associate the IDLE editor with my py script in ArcMap? Thanks. UPDATE: In the Geoprocessing Options window, you need to select the editor located on your computer.
... View more
11-23-2012
12:54 PM
|
0
|
1
|
3149
|
POST
|
Has anyone had a problem with any of their py files getting a Frame not defined or Tk not found error, when the code has no error? I have come across 2 cases recently with this problem. For both people if they have their code, and have zero lines of Tkinter code within, their program runs without error. If they just enter the line of code "from Tkinter import *", they will then either get a Frame not defined or Tk not found, eventhough they have no other Tkinter code defined within their py code. Let me know if u have similar similar problems, and how u resolved them. Thanks. Karl
... View more
03-04-2011
02:02 PM
|
0
|
1
|
707
|
POST
|
MY UPDATE TO THIS QUESTION. I found out from ESRI that arcpy currently does not have that capability. I think I have a work around, but I am unsure of what arcpy command to use. Maybe one of your VB people would know, or if there are any trailblazing python programmers out there. If I make a default table and place it in the layout, I can then find it using ListLayoutElements. When I find it, is there a way to change the layer that is attached to that GRAPHIC_ELEMENT? For example my template can be using junk.dbf. I find this GRAPHIC_ELEMENT, then I use some arcpy command that let's me change that GRAPHIC_ELEMENT from junk.dbf to myRealFile.dbf. I am hunting for the arcpy command to do this. Any codehints? If I make a default table and place it in the layout, I can then find it using ListLayoutElements. When I find it, is there a way to change the layer that is attached to that GRAPHIC_ELEMENT? For example my template can be using junk.dbf. I find this GRAPHIC_ELEMENT, then I use some arcpy command that let's me change that GRAPHIC_ELEMENT from junk.dbf to myRealFile.dbf. I am hunting for the arcpy command to do this. Let me know. Thanks.
... View more
02-02-2011
09:02 AM
|
0
|
0
|
224
|
POST
|
If you open the attribute table for a feature class or a shapefile and you want to display this table in a layout, can you let me know what arcpy command(s) I need to issue? I cannot find an example in the ArcGIS Help. Thanks in advance for your help.
... View more
01-31-2011
11:50 AM
|
0
|
1
|
818
|
POST
|
Hi. I have a comma delimited ascii txt file. It has a sample value, lat, long value in it. I am trying to convert this text file into a shape file. I have verified that the data values are being read in correctly, but when I display the shapefile, all the points are on top of each other at the south pole. Which is of course NOT correct. They should be over Vancouver, BC. Here is the code. Can someone point out what they think i am doing wrong? Thanks in advance. I've been bashing at this for a few days without success! (Note. for some reason the indenting does not show up for the FOR loop, but it is there.) Karl import sys, os, string, math import arcpy arcpy.env.workspace = "C:/temp" outputGDBpath = "C:/temp" outputGDBname = "particulate" fc = "MyData" # Open a new text file to read the coordinates inFile = open("C:\\temp\\particulate_data.csv", "r") arcpy.CreateFeatureclass_management(outputGDBpath, "partSamples2.shp", "POINT","","","","C:/temp/VancouverLLwgs84.shp") outputFC = "partSamples2.shp" # Process: Add Fields arcpy.AddField_management(outputFC, "sample", "LONG", 9, "", "", "", "NULLABLE","NON_REQUIRED","") arcpy.AddField_management(outputFC, "latitude", "DOUBLE", "", "", "", "", "NULLABLE") arcpy.AddField_management(outputFC, "longitude", "DOUBLE", "", "", "", "", "NULLABLE") i=1 rows = arcpy.InsertCursor (outputFC) pnt = arcpy.Point() # Loop through the coordinate values for line in inFile.readlines(): values = string.split(line, ",") #split up the comma delimited line pnt.id= int(i) pnt.x= float(values[2]) pnt.y= float(values[1]) # arcpy.AddMessage ("Long: "+str(pnt.x)+ " Lat:" +str(pnt.y)) row = rows.newRow() # New row into table/cursor row.sample = values[0] row.latitude = values[1] row.longitude = values[2] row.shape= pnt # Assign pnt object property to shape rows.insertRow(row) # Save the row/feature pnt i += 1 del row del rows inFile.close () === end of code. Sample data: 1829,49.292669,-123.135382 3109,49.292669,-123.135382 965,49.292669,-123.135382 3973,49.292669,-123.135382 2477,49.292281,-123.136013
... View more
12-18-2010
08:04 AM
|
0
|
1
|
413
|
POST
|
In python the Tkinter library allows you to create forms. just import it to your py script, then you can start building menus.
... View more
12-08-2010
08:09 AM
|
0
|
0
|
413
|
POST
|
I have a python script with a Tkinter menu interface. When I start the script, it always pops up the Tool Parameters window. I have no parameters. I have to press the OK button before my Tkinter menu appears. Is there some command that I can use in my python script to not have the Tool Parameters window appear? (Even if I do have parameters, I would like to use the Tkinter menu interface to get the parameters.) Thanks. Karl
... View more
11-30-2010
10:15 AM
|
0
|
0
|
462
|
POST
|
I guess there are not many python programmers around here. Well I kept bashing at the code. I saw another sample code in the online help using a for loop, and did not need the fc= fcs.next () line as the while loop did. So when I commented out the next line, and changed the while to a for loop, my program worked! I am GUESSING that the .next () attribute does not exist in ArcObjects after you run the fcs = arcpy.ListFeatureClasses() statement.
... View more
11-22-2010
08:32 AM
|
0
|
0
|
149
|
POST
|
Hi. I am new to python and arcobjects. I am trying to make a simple script that lists all the feature classes in a personal geodatabase, then do some customization to each feature class. I keep hitting an error when I try to get the list of feature classes in the GDB (I assume that the layers in the GDB should be termed feature classes). Here is the code snippet, plus the error message I get. Any help is greatly appreciated. # Import arcpy module import arcpy, sys, os from arcpy import env # Local variables: env.workspace = "C:\Data\module1data.mdb" outputGDBpath = "C:\Data" outputGDBname = "SS" fcs = arcpy.ListFeatureClasses ("*", "all") fc = fcs.next() == I get the error message: fc = fcs.next() AttributeError: 'list' object has no attribute 'next' The gdb has 4 vector feature classes within it. Thanks. Karl
... View more
11-21-2010
11:55 AM
|
0
|
1
|
276
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|