Tag Info

New answers tagged

0

I believe relative pathnames do not work in Model Builder when the Hard Drive letter changes (or across Hard Drives). Also, try setting your Output/Data-Paths to a subfolder from where the toolbox/script resides.


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 do not need to do replace. You just need to modify the format string. "Convert" = "{}{:02d}{:02d}".format(!SignatureYear!,!SignatureMonth!, !SignatureDay!)


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.


0

Right-click the CSRS_0RN_NER_Buffer element and choose "Add To Display" That will work for the dataset if it's written to disk or "in_memory"


0

I made the output feature class of the buffer portion of my tool (CSRS_ORN_NER_Buffer%n%) a model parameter, and even though when I run it it says theres a datum conflict, it seems to work fine through both the ArcCatalog window and ModelBuilder application.


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.


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 ...


0

You need to put the relevant feature class as the input and not the Geodatabase.


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.


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 ...


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 = ...


0

Looks like you have discovered a quirk of the Iterator. There is no indication in the help file that the iterator sorts the field. So the only way I can think of doing this is to add a field to your dataset and you number the rows in the order you wish to visit them. You then iterate over that field.


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 ...


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, ...


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.


0

For your first question, make sure the add field object is created and connected to the feature class before the calculate field object.


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 ...


0

The tool Copy Features honours the qualified field names environment setting. So Use that tool to make a copy of the dataset with the join and work with that.


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 ...


0

I got it working using a python script - which has two output parameters - the sinus and a boolean. The boolean i use as the precondition. See Use value of Field in Calculation in Modelbilder


0

I don't know exactly how you are typing in your code, but my first assumption is if it works in one spot but not the other to check that the parser (VB vs Python) is set correctly and the same way in both places. Second, of course I don't know what specifically your workflow looks like in either spot, but it might be worth double checking in modelbuilder ...


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.


0

How about this idea? (1) Creates your MySinus value which can be positive or negative. Have another Calculate Value tool (called Test) that returns a boolean. True if MySinus is positive and False if it is negative. Test output becomes the precondition to your calculate Hypotenuse?


0

Niels, Looks like a bug in model builder. I was able to replicate the problem too. But I did find a simple solution. In the image below note that my date values have a date component and not just a time. In the Make Service Area Layer tool I added %n% to the layer name to give each layer a unique name ending with a number (the number of times the model ...


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 ...


0

you can use the spatial join to get the attribute of your service area overlapping the parcels. Then you can change the values using the field calculator.



Top 50 recent answers are included