Tag Info

Hot answers tagged

3

You need to separate your model into two models. As you have it now, the results table gets created with every iteration. Step 1 needs to be in separate model that calls a sub model, which performs the rest of the steps. Refer to this help file on how to set up nested models.


3

A check box means user interaction so you will need to look at using either a Python script tool / Python toolbox or a Python Add-in. What you are actually needing is called a value table. Have a look at this link in the help doco.


3

You will need to create a boolean variable and define it as a model parameter. This will add a check box option when double clicking on the model. OR Create a script tool that runs your code and has a boolean data type. Either way you will have to check the boolean value using an if statement.


3

in the code block you'll define a function, and then in the expression, you'll call the function with the needed field names, like so : Code block : def picture_name(current_name, map_number): return current_name[current_name.rindex("\\"):] + "|" + map_number + ".tif" Expression : picture_name(!Pictures!, !MapNumber!) I haven't test this code, ...


2

You have made the classic mistake that people do when they start using an iterator. EVERYTHING runs in a model that has an iterator. So everything up to and including the collects tool must be in a sub model. Expose the collects tool as a parameter. Then drag that model into the master model which has the merge tool. Connect your output from your sub model ...


2

You may use Iterate Feature Selection Iterates over features in a feature class.


2

If Shapefile you can only delete (single delete) one feature set. Or use Iterate with Feature Datasets (Geodatabase) Delete Fields http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000004n000000


2

Personally I would avoid the batch tool approach. Create a sub-model and cycle through the datasets using an iterator deleting the fields as necessary.


2

You could add a Boolean variable and expose it as a parameter then connect it as a precondition to the Make Feature Layer. This will allow ALL layers to be loaded if TRUE or none of them if FALSE. I don't think you can control each layer as this would require you to interact with the model on every iteration and model builder does not work that way.


2

This can be achieved in several steps. Run a Spatial Join for your buffer polygons and road network layers (right-click the buffer polygons layer in the TOC and choose Join and Relates > Join). You will get an output polygon feature class which contains information on how many road features were located (even partially) within the buffered polygons. ...


1

Here is a bare-bones example (borrowing from both Jim and Richard's answers): import arcpy fc = r'C:\junk\FILE_GDB.gdb\Export_output_gdb' # input feature class field1, field2 = 'Distance', 'Type' # fields to sort, and group fcOut = r'in_memory\blah' # output feature class # set up counters bankcount = 0 churchcount = 0 ...


1

I think we can handle this using an arcpy.SearchCursor (I still use the Old School SearchCursor) and usage of the arcpy.Select_analysis() tool. The following is probably inefficient but I hope it helps. This assumes the Banks and Churches layer is held in a File Geodatbase (.gdb): import arcpy BanksAndChurches = r'Path\To\BanksAndChurches\FeatureClass' ...


1

Without seeing the model or the exported Python script it is hard to say this definitively but ... If you have the line below in your Python script: arcpy.env.overwriteOutput = True then it should take care of ensuring that what you try to write can be written. Alternatively, you could use two lines like the following to ensure that the outputFC does ...


1

This code has not been tested, but it should get you going in the right direction: import arcpy from arcpy.sa import * arcpy.env.workspace = "Path/To/Workspace.gdb" arcpy.CheckOutExtension("Spatial") #Static Variables field = "VALUE" #Build list of years rasters = arcpy.ListRasters("x_*, "ALL") #Loop through names, get year and use it to select rasters ...


1

I think the only way to do this currently is to instruct the user to create a point layer (with one point) which is then used as vector layer input in the Processing model. As far as I know, the Processing scripts and models currently don't provide any user interaction capabilities. If you need user interactions, you can write a plugin instead. The plugin ...


1

I'm not sure where %Name% is coming from, so I may not be able to answer your question entirely, but wrapping something in exclamation points is how you get a value out a field in a python code block. %Name% is a model builder variable, not a field name. So remove the the exclamation points and just use %Name%[3:] and see if that works.


1

With instances of ArcMap and ArcCatalog no, each one creates a temp session directory in your %TMP% folder called arc<4 hex digits> like arcA7B0 and is thus unique. For instances of python, yes, it happens frequently. Multiple running instances of python scripts started from command line will cause each other to crash randomly. This limitation does not ...



Only top voted, non community-wiki answers of a minimum length are eligible