0
votes
0answers
77 views

How to export from ModelBuilder as script and then run using Python. 3.4?

I'm currently studying for a Msc in GIS. In my assignment I have been asked to produce a model builder, export that model as a script file and then run that script as a stand alone in IDLE. So ive ...
2
votes
1answer
51 views

Exporting an ArcGIS model to a script, with a script?

I would like to automatically export ArcGIS models to python scripts (and graphics for the model diagram). In order to apply version control to ArcGIS Models my current workflow is to: a) build and ...
0
votes
1answer
36 views

How to schedule a model to run at a certain time?

I'm trying to schedule a model to run at a certain time and have found this ESRI Blog post which is providing a good start. What I can't figure out though is where in the importToolbox function I tell ...
-1
votes
2answers
116 views

Python script not working after exporting it from ModelBuilder

trying to figure out why my script wont work (I should mention I'm still at an intro level). This is a script I exported from ArcGIS model builder which worked fine using that: # Import arcpy module ...
2
votes
1answer
63 views

SQL expression to python expression

I have a SQL expression that I use in Make Feature Layer in Model Builder ("HOSPITAL" = '% HOSPITALNAME%'). The expression makes a selection in a OD Cost Matrix that a patient is patient only at one ...
3
votes
1answer
147 views

Generating a multivalue choice list in ArcGIS using Validation [Not availalbe for Standard License]

I'm trying to adapt a model and script combination found on ESRI's blog site titled 'Generating a multivalue choice list'. However, I've concluded that part of the validation used in the embedded ...
1
vote
1answer
149 views

Best way to use arcpy.GetParameterAsText() or arcpy.GetParameter() to pass a datetime.timedelta to a script?

I have a function that takes a datetime.timedelta as an argument in a script that I want to use in ModelBuilder. I don't see an option for that as a parameter type, so for now I have a solution that ...
2
votes
1answer
77 views

How to get Network Analyst data from script file back into Model Builder?

I am running a script which takes some input parameters and runs some Network Analyst processes. The script is imported into a toolbox and is setup in Model Builder with the necessary input and output ...
4
votes
1answer
73 views

Convert linear polygons to lines

Hi I have some long linear polygons that I'd rather store as lines but I'm not sure how best to do this. Ideally I'd have a line goiung through the centre of the polygon lenthways. I have two ideas of ...
0
votes
0answers
53 views

Model Run from Python script

Ive broken a complex task down to a very simple excersise and still cant get it to work.... I need to set up a Python Scpript to Run a Model. model: "SelectTest" toolbox: ...
2
votes
0answers
154 views

How To Export Selected Data Driven Pages to PDF?

I have a map book with data driven pages that shows the fire boundaries, roads, etc for our fire rescue department. I want to automate the process of creating individual mini map books for each fire ...
0
votes
1answer
148 views

ArcGIS ModelBuilder pass arcpy.SetParameterAsText as input to next tool

I am trying to build a model which uses two simple scripts, Script A and Script B. I want to use arcpy.SetParameterAsText to set an output in script A, which is then used as an input in script B. In ...
4
votes
2answers
243 views

Automating a Python expression to calculate acres

I'm not new to GIS but very, very new to using Python and using scripts. I successfully use a Python expression !shape.area@acres! to update a field with acres in a feature class. What my users ...
1
vote
1answer
158 views

How to set up parameters in Python toolbox tools?

I build a model builder and export it to python. How can I define parameters for python script in python properties? May you explain about Data type in script proprties? thanks alot
0
votes
3answers
224 views

Arcgis CopyFeatures tool extremely slow when exporting to SDE

I have about 10 points in a file gdb that I am attempting to copy over to an sde feature set. In arcpy and in model builder it takes about a minute to execute. Do you know of any tips to speed this ...
1
vote
0answers
158 views

How to compare files in two folders? [closed]

I'm pretty new user of ArcGIS. My intention is compare files (csv) from one folder with files in another folders. In those folders exist files with the same name but in second folder files have ...
2
votes
0answers
176 views

How to programatically set default Geodatabase and Workspaces for a map document?

I have a QC process that has a bunch of models that need to be sequentially run, and then the results manually inspected between each model. I know how to manually set the default GDB for the Map ...
2
votes
0answers
64 views

Convert absolute file path to raster databaset [closed]

I wrote a simple python script that outputs an absolute path as string to a GeoTiff file. So this file can be treated as Raster. In a Model, the GeoTiff file is to be the input raster of a CopyRaster ...
2
votes
2answers
159 views

Trying to use Python code and user defined inline parameters to build a SQL expression

I am trying to build a tool where the end user can run a model and make a selection from a feature class based on 3 different fields, calculate the total shape length, & export the results to a ...
3
votes
1answer
116 views

How can I make my python script results appear in model builder

I have a model (model builder) and within I added a python script to calculate a field. My problem now is, that I don't know how to make the output appear in my model as it is the same as the input ...
3
votes
0answers
417 views

How to rotate and move polygons to different angles using ModelBuilder (or ArcPy)?

I have a few thousand polygons (all square) that I need to rotate to various angles that are in the attribute table, and then move so that each polygon gets moved 3/4 up from the original centroid, ...
1
vote
2answers
285 views

Python code does not work with RasterCalculator after exported from Model Builder

I have a model authored in Model Builder that uses "RasterCalculator" to process input raster datasets. arcpy.gp.RasterCalculator_sa("OutRas = Con(\"%STATIC_forestland%\" == 0, -255, ...
4
votes
5answers
912 views

How to move / offset point locations using ModelBuilder or ArcPy

I have a number non-georeferenced CAD layers (see this question) that have text annotation features. I have created a model to convert the text to points, but after converting the annotation to a ...
0
votes
1answer
129 views

Why does script exported from ModelBuilder give ERROR 000733 at SelectByLocation?

I created a model in ModeBbuilder, and I exported the model as a script, but when I try to run it I get the following error. I have added my error below and the code below that. Thanks for any help. ...
-1
votes
2answers
350 views

Error 000368 selectbylocation in script from model builder

Can anyone help? I created a model-has buffer,clip, selectbylocation.... I exported the model as a script but when i try to run it i get this error: Executing: IGISprogrammingscript ...
3
votes
2answers
362 views

Append or merge consecutive line segments (contours) as one single line of the same elevation value

Is there a way using python (ArcPy) or ArcGIS 10.1 tools to collect consecutive line segments having the same elevation value and appending/merging/generating one single line from them? Each resulting ...
2
votes
2answers
182 views

Create line from two points, two different feature class

I'm attempting to automate this in ModelBuilder in ArcMap. I have one feature class with one point (Start) and one feature class with multiple points (Destinations). I want to iterate through the ...
2
votes
1answer
112 views

How can I set the settings of an Address Locator within a Model or arcpy?

I am creating a model that processes a large road dataset, then creates an address locator from the roads. The Create Address Locator tool does not allow me to set options like Spelling Sensitivity or ...
6
votes
1answer
273 views

ModelBuilder: How to extract data by date, export to separate tables and interpolate tables to rasters

I've been using ArcGIS for a couple years, but when it comes to model builder I've only worked with very simple models. I'm hoping someone that is much smarter than myself can help me in building a ...
1
vote
1answer
89 views

Custom Model should be used with ArcMap or ArcCatalog?

I have one basic question , when you create custom model using model builder in ArcGIS. It should be used with ArcMap or ArcCatalog? Reason I am asking this question is I have created a model and I am ...
0
votes
1answer
63 views

How can I hide custom model from mytoolbox in ArcGIS

I am created model in ArcGIS using model builder and python script. To build main model I have created some submodel and script in the same toolbox. I just want to show main model in the toolbox and ...
45
votes
6answers
3k views

When to use ModelBuilder over Python scripting and vice versa?

I am new to Python scripting in ArcGIS but not new to ModelBuilder. I would like to know the benefits of Python vs ModelBuilder. When should we write Python script for GIS automation rather than ...
-2
votes
1answer
185 views

How to write Process Dialog log information to text file in ArcGIS?

I have created a custom model. When this model is run, it shows a process dialog which has some log information. I want to write that log information into the text file for further analysis. Does ...
2
votes
1answer
226 views

ModelBuilder: Multiple Iterators and Clipping

I have two separate polygon layers. One layer consists of voronoi polygons. The second layer consists of buffers, many of which overlap. I need to do is iterate through each voronoi, clip only the ...
2
votes
2answers
138 views

How to use model-builder iterator with a custom bit of arbitrary code?

How do I integrate a in-line variable from modelbuilder into a python script? Specifically, I'm using an iterator, and I'm trying to include the 'name' variable in a python script. I believe the ...
4
votes
2answers
606 views

Arcpy remove invalid character

I've built a model that takes the name of the Excel worksheet containing xy data, and uses that name as the name of the output shapefile. ( Worksheet "massachusetts_sightings" in an xlsx becomes ...
2
votes
0answers
797 views

Why am I getting an ERROR 000728: Field *fieldname* does not exist within table even though field exists?

I do some script for a shapefile's table. And this script works for 2 fields and do not for other ones, because of: ERROR 000728: Field FID_158_01 does not exist within table But this field is ...
2
votes
2answers
1k views

how to get ALL FIELD NAMES from table? (using arcpy.ListFields)

I have a table: , Script at ModelBuilder's "calculate values": Expression: a("%path%") Code BLOCK: def a(path): fields = arcpy.ListFields(path,"FID_*") for field in fields: return ...
0
votes
0answers
148 views

How to iterate throught fields names in a table and change row values?

I got table like that one (Example). I need to change 0 to 1 and -1 to 0 in each field except first and second. The problem is that every time i have different number of fields and field name is ...
8
votes
5answers
757 views

How to split points by polygon?

I am looking for a way to split points by a county polygon feature class. The attached image shows two feature classes: one composed of points and the other a county polygon feature class. The split ...
3
votes
3answers
1k views

How do I access a multivalue output parameter from a python script in modelbuilder in ArcGIS 10.0?

How do I access a multivalue output parameter from a python script in modelbuilder, in ArcGIS 10.0? That is, I have a python script that loops through several input layers (working through a script ...
2
votes
1answer
177 views

arcpy Tool works in debug mode but not in normal model

When I try to run the following simple script from arcmap it fails but when run using right--click debug and then F9 (debug) in python scripter it works fine. I don't understand why??? # Modified ...
1
vote
1answer
499 views

Replace data source of layer in ModelBuilder

After reading through the documentation about MapDocument and Layer classes, I have been trying to use the replaceDataSource method in ModelBuilder to replace the data sources of certain layers within ...
4
votes
0answers
490 views

Stop an arcgis model until all values are collected and then continue

This is similar to Modelbuilder - If precondition is false, continue iterating next input but I want the iterate tool to run to collect all the values and only then continue to the merge. Any ideas? ...
0
votes
1answer
112 views

Issue with branching model

I am having an issue with a branching model when the iteration tool is used. The test code/scripts/models are in Google docs or arcgis forums It runs and creates both versions of the process whereas ...
4
votes
1answer
592 views

Raster Calculator dynamic map algebra expression

Is it possible to dynamically construct a Map Algebra expression that is dependent on the output of another tool, either using model builder or arcpy? For example, say I have a model that performs a ...
5
votes
1answer
2k views

Create a definition query for groups of layers: Is it possible?

I have a large number of groups created, with each group having many layers. I have looked for a way to set a definition query for all the layers in each group but haven't found anything. Is it even ...
1
vote
2answers
1k views

How can I insert new records to an ArcSDE feature class from a view in ArcSDE

I am wondering how I can both insert new records from a view to a feature class and update data that may be newer in the view than in the feature class. I have been fumbling around in modelbuilder and ...