Tag Info

New answers tagged

0

You could also use "%Name%".replace(".tif","") in Calculate Value in Model Builder


0

i am not sure if you got this answered . i am not very good with model builder , but your basis of your problem seemed similar to the one i had when i was making layers for each unique value within a feild. I was using the value for the deinfation query and the name. But i ran into problems as the value could be john/ street. So when it was used in the ...


1

Use a try catch to fetch error messages from the gp object. try { GP.Execute("Creation", parameters, null); } catch(exception ex) { Messagebox.Show(GP.GetMessages(<severity>)); }


0

You should be able to use this option: http://resources.arcgis.com/en/help/main/10.1/index.html#//001w00000008000000 I am sure you can get there with field mappings if that doesn't work, but it would likely be a lot more lines of code than what youd expect. https://geonet.esri.com/thread/30539


0

Just an idea but if your output was a GeoDatabase Featureclass rather than a Shapefile you could use the Alter Field tool to rename it back as part of the work flow of the model?


1

Make your current output a temporary dataset and then run Append GP tool to add the results into a final output dataset.


0

You can run your cell statistics with all the rasters (GRIDs) as they are. Provided you haven't put them into folders that are too deep in the folder structure (more than 128 characters), but there are ways to get around even that: In a command window type SUBST /?, this will show you the help for the subst command. You can set a 'fake' drive to a path deep ...


0

You might try an OS Crawl while listing your rasters and running the CellStatistics and saving the result into the same location as the parent. I got the following to work on folders of .tiff rasters. import arcpy import os import math arcpy.CheckOutExtension("Spatial") from arcpy.sa import* import sys arcpy.env.overwriteOutput ...


0

If you want to do this in geoprocessing create your buffer (as normal, to a temporary feature class) and then append the results into your feature class. With geoprocessing you can either completely overwrite an existing feature class or not; the append tool allows you to add to an existing feature class. You will need to use your own knowledge of your ...


0

As you have correctly noticed there is no way to run this as a GP tool or as a ModelBuilder process. The Buffer GP tool will create an output feature class with buffered features. The only way to achieve what you want is to use Python (arcpy). You can access individual features' geometry objects with the arcpy.da.SearchCursor and then use the Geometry ...


3

Another solution that is in concert with Aaron's solution, arcpy.AlterField_management(r'C:\Data\Garbo.gdb\Khyber', 'oldfieldname', 'newfieldname', 'ALIAS') is the easiest way to achieve this. There is the equivalent geoprocessing tool named "Alter Field" to be used in Model Builder. This tool is available starting with 10.2.1 Before running the model ...


2

Feature Class to Feature Class would be your answer. Particularly Field Mapping part is what you are after. If you look at the example below, names of the three fields on the left table are altered to new ones with this tool. One last note, if you have many fields to rename, this approach could be advantageous over the answer in terms of processing speed ...


5

You cannot rename fields in an attribute table. However, you can add a new field and copy the values from the old field to the new one. Finally, delete the old field if you wish. In sum: Add Field Calculate Field Delete Field (optional)


2

It turns that one liners which aren't core python (don't require imports) need to be wrapped in a function: validate("%Field Name%") def validate(s): import arcpy return arcpy.ValidateTableName(s) I thought that since this was in an arcgis model that arcpy would automatically be available, but apparently that's just silly thinking. ;-) /sarcasm ...


0

This seems like something that should be very easy but requires an extra step. The solution I came up with is to create a dictionary.csv file in excel containing a "Key" (layer #), and a string (name). Use the table select tool to select rows from the dictionary where the key is equal to the layer #. This will output a new table containing only a single ...


1

I was able to convert the numerous tiled contour data files to a CAD format by inserting an additional step into model builder. I used the "Feature to 3D by Attribute" tool and assigned the elevation field as the "Height" field and then converted to .dxf or .dwg One of the first things I did with this contour dataset after projecting it was run it through ...


0

This wont answer why model builder isn't working but its rather another option for bulk conversion to DWG. I have tried this in 10.2.1 on various contour layers (shapefiles) and it converts them to CAD with their elevation still intact. Basically the script finds all the .shp in a specified folder (see arcpy.env.workspace = r"D:\FolderContainingShapefiles") ...


2

In Python, a backslash in a string always signals the presence of a special character. For example, a "\t" will be interpreted as a Tab. I tested your "Calculate Values" expression in ModelBuilder with a path of "C:\Workspace\trash\temp.gdb\poly", and my result was "C:\Workspace rash emp.gdb\poly". Each "\t" was changed to a Tab. To prevent python from ...


1

Try the "make feature layer" tool. Connect the output from "Calculate Field" to "Make Feature Layer". You should then be able to connect the output of "Make Feature Layer" into the Dissolve tool.


0

If the 35 AOI's are 35 polygons in a single dataset then you iterate through these using the Feature Selection iterator. The output of this would be your clipping layer.


0

To accomplish this task, the overall work flow will be converting your lines to polygons. The FeatureToPolygon tool will only convert closed lines, so this will work well for limiting the lines you are working with. Next you'll want to remove all donut polygons from your analysis, which can be done with a cursor, checking if each geometry is multipart. You ...


2

Go to "Arctoolbox-> data management tool-> Field ", find the "Calculate Field" tool and drag into ModelBuilder, double click the calculate field, input a value which you want to set or use expression to set the value. Hope it works, good luck!


1

For this, you'll have to project your feature class to determine the values. Check the code below, which creates a NAD27 spatial reference, projects, uses a dictionary to store the desired data, and then updates the feature class with the Xs and Ys. The script assumes there is a unique ID field for your feature class, as well as a NAD27 X and a NAD27 Y field ...


1

There is a set of add-on ArcGIS Desktop tools (versions 9- 10.2) using network kernel density techniques developed by Professor Okabe available here. http://sanet.csis.u-tokyo.ac.jp/. However they are only licensed for academic use. I used them on my MSc thesis and they worked really well. I guess you could enquire about commercial implementations. ...


0

%FID% is what is known as an in-line variable. However, you have not exposed a variable called FID at the moment. If you replaced this with %Value%, your model would work, and the outputs would have the name of the "Value" coming out of your iterator. There are 2 options to do what you are trying to do: Within the Iterator, Group by FID. This will mean ...


1

As you discovered, a model can have only one iterator, so you can not copy the contents of each submodel having an iterator into one bigger model. Instead, depending on your needs: 1) If the models are totally independed (one model does not create output for the next model), you can simply throw all (sub)models into a "master" model and click run. It will ...


1

I assume that it goes wrong when your model becomes white?! After you've used Dissolve, won't the output be a feature class and thereby not a layer. In modelbuilder Select Layer By Attribute only works with layers. Put in a Make Feature Layer tool after the Dissolve to start a new selection.


2

New answer to an old post, just to clarify how to create a re-usable model to do this. Open the model, Insert-> Model Only Tools-> Calculate Value. In the Expression, type: getuser() In the Code Block, type: def getuser(): import getpass return getpass.getuser() (See "Getting user name in specific format" for source of username code snippet ...


2

You must have a different version of ArcMap than I'm using (10.2.2), but I got counties along the Texas border just fine (where my state boundary crossed county boundaries, which was not everywhere in New Mexico since my state and county layers are different resolutions): Things to try: Make sure your state boundaries match the county layer visually, ...


1

Use the Spatial Join tool with the One to Many option and a Search Radius value of 1000 (assuming your geometry units are already in feet). Your Practice Sales1 will be the Target features and the Practice Stops will be the Join Features. This will duplicate the Practice Sales1 features to match the number of Practice Stops points within 1000 feet of each ...



Top 50 recent answers are included