Tag Info

Hot answers tagged

4

Here's what you need to do, with comments: # Reference the MXD containing your layers. # If you're doing this in the Python Window of the MXD, # use the "CURRENT" keyword instead of providing a path # to the MXD you already have open. mxd = arcpy.mapping.MapDocument(r"C:\Users\Daimon Nurse\Desktop\Zonetrial.mxd") # mxd = ...


3

This can be achieved with use of a Spatial Join (right click in table of contents -> join -> join data based on spatial location). The spatial join will allow you to transfer attributes from one feature class to another based on location. However, I have always run into issues with boundaries when I perform a spatial join between polygons. To make sure your ...


3

The intersect tool expects a feature class or a layer as input. But you try to use a geodatabase as input. Add two feature classes (or layer) to ModellBuilder instead of two geodatabases.


3

Not sure I am understanding the workflow correctly but like Beck said I think this is does the trick. Foo is the original shapefile you are deleting all the features from, Bar is the layer you are copying features from. import arcpy # Data foo = r'C:\Path\to\layer\that\will\be\blank.shp' bar = r'C:\Path\to\layer\that\gets\copied.shp' # Delete Features ...


2

Here's how to find all the mxds in a directory tree using the os module: import os for root, dirs, files in os.walk('C:/junk'): for file in files: if os.path.splitext(file)[1] == '.mxd': print 'It is an MXD!'


2

To rename a parameter name, rename the element in the model itself. Next, the 'linear' option will always be there as long as you expose the distance parameter from the buffer tool. A workaround would be to create another variable of 'Double' type and call it "Distance" Then connect that variable to the Buffer tool and assign it to the "Distance [value ...


2

In model builder, you can set variables from a tool's parameter. In model builder, right click the tool, go to 'Make Variable', and click 'From Parameter'. Then you can set that variable to be a 'Model Parameter', which means the user will specify that variable. The other things will stay as you set them for the tool in model builder.


2

I can understand why its not working, but its difficult to type out and explain the whole reason - so I'll just explain the better way to do what you want to do: Make feature layer isn't required in your workflow. You're using it to help select a featurelayer on something that is already a layer. (You arent making a layer, nor using the expression) Instead ...


1

You do not need to do replace. You just need to modify the format string. "Convert" = "{}{:02d}{:02d}".format(!SignatureYear!,!SignatureMonth!, !SignatureDay!)


1

I don't think it'll show up if it is set to be temporary. I assume you want it temporary so that if another selection is made and the tool is run again, only the new buffer shows. One possibility, you could add a step to your model that, if a buffer exists, deletes the existing buffer before running.


1

So after considering several options (including replacing the Polygon To Raster with the Feature To Raster - which did not produce the expected result) I decided to trim the name of the feature class. And the miracle happened, ArcMap did not crash. Looks like that Arc Model Builder is happy with short names but will crash if the input has a lengthy name. The ...


1

You could try a few things to find the root cause. First, can you isolate the issue down to particular feature classes? This might indicate that there may be an problem with your feature class. Second, try running the model in ArcCatalog and test. Third, try disabling any third party extensions you might have installed.


1

I've run into a similar problem with models not wanting to run even if everything is perfect. You'll probably need to either set up dummy files or set dummy—but valid—default values for all the inputs that show up in white. Once all the inputs are showing some sort of color you can save the tool, run it, then change the inputs to what they're supposed to ...


1

You need to set a default value for the Selecting Features Layer. Ideally this would be the layer file the user is going to be selecting the most. Once there's a valid value in the Selecting Features layer variable, that oval should turn a different color and the model should run. It's one of those annoying little idiosyncrasies of ModelBuilder that will ...


1

I believe you can set predetermined variables as values for the input parameters. If you right click on the Buffer tool in Model Builder, and go to Make Variable --> From Parameter --> And then select the parameters which you want the user to set a value for Then set the default values in the Buffer tool properties that should stay constant (Side Type, ...


1

Well, assuming your polygons have some unique identifier, be that a GridID, unique feature ID, or even GlobalID, probably one of the easiest methods would be to use any of several available methods (I'd recommend ideally merging all the polygons together into one FC and then spatially joining that polygon FC to the split roads), to transfer the unique ID of ...


1

You have to define a dynamic name for the output of the Dissolve tool, otherwise it will be overwritten each time the iterator processes a polygon feature class. 'Name' is the name of each feature class being iterated, you can use it by naming the output something like C:\Users\...\Default.gdb\MACK_%Name%. See the 'Note' section of the help page A quick ...


1

In the main model, right-click the sub-model and choose Make Variable > from parameter > [sub parameter name]. This will expose the sub-parameter model to the main model and you should now have it in the list of all the main model parameters.



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