POST
|
Thank you Lance - that worked!. Not sure I understand the "why" this is necessary, but Ill take it. I find dealing with dates when working in model builder/ArcGIS interfaces non-intuitive and more complicated than I would think they should be, but hopefully Ill catch on to the logic at some point Thanks again
... View more
06-15-2019
03:00 PM
|
0
|
3
|
2518
|
POST
|
I cant seem to get best way of handling date fields in ModelBuilder/ArcGIS environment. I created a very simple model in ModelBuilder that accepts a date object (that I used with 'Create Variable) (see first graphic). All I am trying to do is calculate that date object as a string formated in (YYYYmmdd) using the 'Calculate Variable' tool. I expected that since it is a date object that I could simply just use the ".strftime" method to format the date (see 2nd graphic). However I get an error message (3rd graphic) that seems to be implying that the object is an integer. Can someone point me to how this should be done? I also tried constructing the date using using datetime.datetime.strptime() and then using strftime(), but that didnt work either thanks Neal
... View more
06-15-2019
06:30 AM
|
0
|
5
|
3110
|
POST
|
Hello, I have a fairly simple model that creates a subset of a point feature class using the 'Select' tool, and then assigns raster values for 7 different rasters using the ' Multi Values to Points' tool (see below). When I run it in the ModelBuilder interface everything works fine everytime. However when I run it through the toolbox, it seems to run fine (see 2nd graphic), but it deletes the feature class that it creates, so essentially does nothing. Any ideas why this may be happening? Ive confirmed that the output feature class that it writes is not 'Intermediate'. I only have this problem with this tool. There is very frustrating as Im trying to run this in a series using a batch script tool, but it creates the process to fail Any insight/help would be greatly appreciated! Neal
... View more
06-14-2019
11:09 AM
|
0
|
1
|
324
|
POST
|
Hi Joshua - this helps thanks! I wasnt putting the datetime.datetwice I
... View more
06-01-2019
02:16 PM
|
0
|
0
|
5173
|
POST
|
Hello, I am stuck with syntax for what I think will be very easy task. I have a feature class with a date field that I simply want to convert to a string field in yyyymmdd format, so that I can combine it with other fields to create a unique ID. Id like to do this in a simple field calculator (in ArcMap) session with python I tried using the strftime method with simple expression but that doesnt work !mydatefield!.strftime('%Y%m%d'). I also tried a few other things but keep getting error Any help would be greatly appreciated! Thanks Neal
... View more
05-31-2019
05:16 AM
|
0
|
8
|
7295
|
POST
|
Hello All, I have a custom toolbox that has a bunch of tools. I want to add a simple "pre-cursor" tool that sets the changes the default, current, and scratch workspaces to user-defined locations and save those locations such that whatever changes are "seen" by all subsequent models. Seems like this should be easy, but was not clear best way to do this Thanks Neal
... View more
05-26-2019
04:38 AM
|
0
|
1
|
510
|
POST
|
Hello, I have a custom toolbox that I have created with a bunch (20+) of ModelBuilder tools. I have created a Script Tool in Python that basically runs all of the individual tools in batch mode. The script tool is stored in the same tool box (different tool set) than the individual components. In order to run the script tool successfully it seems I have to explicitly load the toolbox (arcpy.ImportToolbox(<name>.tbx)) even though Im running the script from the tool box that is already loaded in the current ArcMap document/session. If I dont load it, I get the following error (the RskPreA_rarr is the name of my first model/tool) Not that it is a big deal to load the toolbox, but this seems like rather odd behavoir that I dont recall happening before in other things Ive done. Any insights on what is happening or if I am setting up something wrong? Thanks Neal
... View more
05-08-2019
09:05 AM
|
0
|
0
|
291
|
POST
|
Hello, I have some ModelBuilder models and Python scripts that create "in-memory" feature layers. If they are already created, is there a way to load them into ArcMap? If I try to run a standard geoprocessing tool in my session, I can they show up as options, but wanted to see if direct way I can load them. Thanks Neal
... View more
05-07-2019
09:11 AM
|
0
|
1
|
793
|
POST
|
Hi Paul - The python script (as script tool) is intended to run in the ArcMap session since it references some standard feature layers (rather than explicit feature classes) and uses in-memory layers. Attached is the actual error Im getting. Oddly enough, is I have an earlier version that I backed up that works with the older data. Maybe something got corrupt in my toolbox, but just very odd and seemingly random
... View more
04-15-2019
04:21 PM
|
0
|
1
|
1459
|
POST
|
Hello, I have created a toolbox and developed a series of about 20 tools in ModelBuilder that represent different components of an analysis. Each model runs fine without error when run in model building or executed in the Python command line within ArcMap. Some of the models are fairly complex and involve iterators, in-line variables, etc. I created a script tool with an associated Python script that basically runs all the component models in sequence. Most of the models run fine, but a few that have iterators keep giving error when run through the Python Script tool. The first model that the script chokes on involves an iterator with the 'Get Field Value' tool that then writes a value to a variable field name based on the get value value. The values that should be produced start at 2 and go to 500. However, when I run Python script it for some reason returns a value of 1 and then bombs. Again model run fine in model builder. Below is an annotated screenshot of model. Im stumped where/why it is return a value of 1. Any ideas on why something in ModelBuilder works but not the identical process run from python script? The input parameters and model reference work fine - so it is definitely something occurring within the model. I cant imagine it is something in the script itself because it is just calling the model and the other models run fine. Any help would be greatly appreciated Thanks! Neal
... View more
04-15-2019
03:17 PM
|
0
|
4
|
1693
|
POST
|
I have a table (tblImprv) with two fields - an unique ImprvID and an associated ParcelID. There can be 1 or more improvements. What I am trying to do is create a query for this table that returns the ParcelIDs and the number of improvements. I realize I can do this by summarizing the data on ParcelID and returning the count, but was wondering if something like this can be done using the 'Make Table Query' using a subquery. The general SQL syntax I would use would be something like that shown below, but Im not clear how to implement in Make Table Query tool or if it can event be done. Ultimately I want to only select the parcels with 2 or more improvements, but I cant even get past this first step (SELECT ParcelID, Count(ImprvID) AS CntImpv FROM tblImprv GROUP BY ParcelID;) Example tblImprv and query result
... View more
02-13-2019
04:36 PM
|
0
|
0
|
524
|
POST
|
I too have this problem and surprised more folks arent asking for it. If I am understanding Eric's question, what I believe we really want is to be able to access and query a field in a separate table that is defined through a relationship class (or relate) using a SQL expression. For example if I have parcel table that has physical and economic information (acreage, value, etc.) joined through a common Parcel ID to an owner table that has information on owners (name, etc.). If I "in" the owner table and I want to query owners associated with parcels that are greater than some size (say 5 acres), where parcel size is in the parcel table, it would be nice to do that "programatically" in code use SQL and/or Python rather than doing the query and clicking a button on the interface to select those records. This functionality was actually available back in the ArcInfo workstation days (using "Info and "Tables" ). Back then you could name a relate, and then access fields in the related table using the relate name similar to example below: select <relate name>//<related column name> > 5 select ownpar//area_ac > 5 If this functionality is somehow available now, I would love to know.
... View more
01-08-2019
12:17 PM
|
1
|
3
|
870
|
POST
|
Good Morning Im not sure, but last I checked several months ago it still hadnt been resolved Thanks neal
... View more
11-12-2018
04:33 AM
|
0
|
0
|
526
|
POST
|
I got it to work on a simple test. Below is Python code that worked to move just the first vertex of a polyline based on updated coordinates. NewX1 and NewY1 fields are updated X,Y. Attached is simple graphic import arcpy fc=r"C:\Users\nbanerjee\Documents\ArcGIS\Default.gdb\kmeline" with arcpy.da.UpdateCursor(fc,['SHAPE@','NewX1','NewY1']) as cursor: for row in cursor: geofeat=row[0] geoarry=geofeat.getPart(0) oldX1=geoarry[0].X oldY1=geoarry[0].Y #print('{0},{1}'.format(oldX1,oldY1)) geoarry[0].X=row[1] geoarry[0].Y=row[2] newply=arcpy.Polyline(geoarry) row[0]=newply cursor.updateRow(row)
... View more
03-19-2018
10:37 AM
|
0
|
0
|
1720
|
POST
|
Thank you - that was the trick. I was hung up on syntax of working with tuple.!
... View more
03-19-2018
08:28 AM
|
0
|
1
|
1720
|
Title | Kudos | Posted |
---|---|---|
3 | 09-10-2022 07:03 AM | |
1 | 07-29-2019 05:38 PM | |
1 | 07-29-2019 06:23 PM | |
1 | 06-15-2020 11:58 AM | |
1 | 09-12-2022 04:05 AM |
Online Status |
Offline
|
Date Last Visited |
02-13-2024
11:20 AM
|