Tag Info

New answers tagged

0

The double quotes indicate your field name and should not be escaped with a backslash. Try this instead: where_clause = '"AreaSqKm" > {0}'.format(subsize) To test that works I created the test code and tool dialog below, and it worked. I reported a couple of variable values using arcpy.AddMessage() to ensure that they were actually set to what I ...


0

You do not need the escaping backslash ('\"') since you are using single quotes to enclose the whole string. This should work. where_clause = '"AreaSqKm" > {0}'.format(subsize)


3

You have to get the mxd parameter in the Python code as a string first and then create an ArcMap document object. In the script tool properties, you can still use the parameters data type you've specified, but you cannot pass directly this object to the arcpy code. mxd = arcpy.GetParameterAsText(0) mxd_doc = arcpy.mapping.MapDocument(mxd) #create an ...


1

One option is to first use the Join Field tool. Joins the contents of a table to another table based on a common attribute field. The input table is updated to contain the fields from the join table. You can select which fields from the join table will be added to the input table. But, beware because this actually alters the input table- it's not ...


1

This seems to be answered by the Calculate Field (Data Management) documentation: When calculating joined data, you cannot calculate the joined columns directly. However, you can directly calculate the columns of the origin table. To calculate the joined data, you must first add the joined tables or layers to ArcMap. You can then perform ...


0

Try replacing this: Ausrichtung = float(arcpy.GetParameterAsText(9)) if Ausrichtung == '#' or not Ausrichtung: Ausrichtung = "0.0" arcpy.AddMessage("Ausrichtung"+ Ausrichtung) with this: Ausrichtung = arcpy.GetParameterAsText(9) # do not float() until you know it's numeric if Ausrichtung == '#' or not Ausrichtung: Ausrichtung = 0.0 # a float, ...


3

Here is a really jankety solution using wxPython: import wx import os def get_pid(parcels): app = wx.App(False) frame = MyForm(parcels) frame.Show() app.MainLoop() txt = os.path.join(os.environ['USERPROFILE'], r'Desktop\temp_parcel_Id.txt') with open(txt, 'r') as f: pid = f.readlines()[0].strip() os.remove(txt) ...


1

If I remember correctly, there is no arcpy equivalent to raw_input that can be used in an ArcGIS environment. I would suggest a workaround. One thing you might do is have a second script for these instances. Save any intermediate data at the point where the user needs to make his or her choice. Have your second script reference the saved data as needed and ...



Top 50 recent answers are included