|
POST
|
Chris, glad it gave some results! For you (10.1 to 10.2) I removed the dialogue box that will tell the user that the tool is running via a progress bar. Apparently this feature became available starting 10.3. It is funny I already started thinking of improvements for the tool and they would address your issues 1) Add another button to find overlaps of lines (which will make sure that street segments are broken at intersection. You would probably get "false" overlap errors in case of an overpass) 2) You and HeatherW had the same request, which is a great idea. I'll have to figure out how I can in cooperate the functionality of the user being able to choose where the geodatabase goes. 3) At the moment the dangle tolerance is set to 1 foot, maybe add a combo box to let the user choose the feet? The way it works at the moment is, it buffers (1 foot) around each dangle and if it the circle hits the street more than once, it is a valid dangle. By changing the radius it would have probably popped up the one in your picture. At the same time we don;t want to make the radius too big. Again thanks for the feedback. This will be a work in progress! Tim
... View more
04-20-2017
10:09 AM
|
0
|
2
|
2579
|
|
POST
|
Sad to hear that cdspatial Could you give this one a try? Dropbox - TopoAddIn.esriaddin
... View more
04-20-2017
08:41 AM
|
1
|
5
|
2579
|
|
POST
|
Latest update added some dialogue pop ups when you run a check.
... View more
04-20-2017
07:40 AM
|
1
|
0
|
1340
|
|
POST
|
Another quick update: The new dangle tool is very Memory heavy when you have 50k+ road network. I had to close my 10 google chrome tabs and then it would work. Before it would crash my ArcMap.
... View more
04-20-2017
05:42 AM
|
0
|
0
|
1340
|
|
POST
|
Joe, the latest version should dramatically cut down on the "false dangles". I can't wait to see your wishlist Tim
... View more
04-19-2017
11:58 AM
|
0
|
1
|
2579
|
|
POST
|
Hey Ian, I was able to turn addOutput to True before Add rule and Validate, which gave me the desired result. If that wouldn't have worked, I would have used ExportTopologyErrors_management and added the output feature layer to my mxd. Tim
... View more
04-19-2017
08:07 AM
|
1
|
0
|
979
|
|
POST
|
Hey everybody, On a monthly basis I create a bunch of topologys to make sure that my polygon layers don't overlap or have gaps (ESN). I also run a topology on my street layer to find street segments that aren't snapped. This process consists mostly of models. Since I always try to help my Public safety brethren, I figured I compile my process in a Python AddIn, that "should be easy to use". I started a day ago and have the skeleton of the AddIn finished and now I am looking for a Guinea Pig (I am looking at you Chris Donohue, GISP & Joe Borgione ) to use it! Latest Update: - Created an official document: Topology Check Python AddIn (6/30/17) - Added Error message when the wrong feature is chosen for certain Checks (i.e. polygon feature is chosen for dangle check) - Now works with ArcGIS Desktop Standard - Latest test version that includes a polygon break check. This check make sure that your line features are broken when they intersect with a polygon feature. Just select the line feature and polygon feature in the TOC and run the check. Dropbox - TopoAddIn.esriaddin 10.3.1 + version Here is what you need: ArcGIS Desktop Standard 10.3.1 or later versions Here is how it works: 1. You would download the add in HERE. (10.1 version HERE ) 2. Double click it and install it. 3. Open an MXD and add a polygon layer and a street layer. 4.The toolbar should be there but if it is not click on Customize -> Toolbars -> TopoCheck 5. Follow the steps in the screenshot! As I said it is still a work in progress, especially the street dangle check. Let me know what you think! Tim
... View more
04-19-2017
08:00 AM
|
11
|
77
|
13873
|
|
POST
|
Hello everybody, I am creating a Python AddIn, that creates a topology, then adds a feature layer and rules to it. After I run the topology validation, I would like to add the topology to the mxd that is open. When I set arcpy.env.addOutputsToMap to True, it adds the topology but before I add the rules, features and validation. Is there any way to add the topology once everything is done? Thanks, Tim
... View more
04-19-2017
05:11 AM
|
0
|
2
|
1542
|
|
POST
|
Bruce thanks for the code! How would I create a date field?
... View more
04-17-2017
07:54 AM
|
0
|
0
|
2225
|
|
POST
|
Thanks for the hint Curtis, since I will have to do that for 40 fields I am looking for any way to speed up my code.
... View more
04-17-2017
05:58 AM
|
0
|
3
|
2225
|
|
POST
|
Great post Curtis! You are right, without model builder I wouldn't have known how to structure my python code. Not to mention, I didn't have to write many lines of code by exporting the model to python. Now I can just copy paste it into my python toolbox.
... View more
04-17-2017
05:55 AM
|
0
|
0
|
591
|
|
POST
|
In line 84 I replaced parameters[0].value with parameters[0].valueAsText and now it is working. I assume parameters[0].value is the original feature layer without the extra fields and parameters[0].valueAsText grabs the feature layer with the new field.
... View more
04-14-2017
08:36 AM
|
1
|
5
|
2225
|
|
POST
|
Sadly it didn't work. I have a feeling that I need to somehow update the parameters[0].value before I run the CalculateField.
... View more
04-14-2017
06:30 AM
|
0
|
1
|
2225
|
|
POST
|
Joshua, thanks for the quick reply. Yes the field is created and when I run the tool again it gets populated. I will have to add a total of 40 fields. That might be enough time for the first field to be available? But I will try the time.sleep approach first. Thanks, Tim
... View more
04-14-2017
06:26 AM
|
0
|
0
|
2225
|
|
POST
|
Hey everybody, I am creating python toolbox and one of the tools adds a bunch of fields to a feature class that the user chooses and after wards calculates those fields with values from the original feature class. I run into the issue that the field calculations can't run because the fields haven't been added yet. This is the code I use: import arcpy
class Toolbox(object):
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the .pyt file)."""
self.label = "My first python toolbox"
self.alias = "Examples"
# List of tool classes associated with this toolbox
self.tools = [Tool1]
class Tool1(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Nena Street Tool"
self.description = "Example showing how to create a value table tool with drop downs"
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
#
# Define Parameter 0
#
# Param0 will be a FeatureLayer
param0 = arcpy.Parameter(displayName = "Your Street Layer",name="Site_layer",datatype="GPFeatureLayer",parameterType="Required",direction="Input")
#
# Define Parameter 1
#
param1 = arcpy.Parameter(displayName = "",name="Activity_layers",datatype="GPValueTable",parameterType="Optional", direction="Input")
param1.columns=[["String","NENA Field"],["String","Your Field"]]
# This says the filter on the second column will be a value List
param1.filters[1].type="ValueList"
param1.value = "Source; Updatedate; Effective; Expire; RCL_NGUID; AdNumPre_L; AdNumPre_R; FromAddr_L; ToAddr_L; FromAddr_R; ToAddr_R; Parity_L; Parity_R"
# This adds a dummy value to the list, this will get overwritten by the updateParameters function
param1.filters[1].list=["Please Select a street layer"]
# Create a list of parameters and return
params = [param0,param1]
return params
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
if parameters[0].altered:
fields = arcpy.ListFields(parameters[0].value)
mylist = []
for field in fields:
mylist.append(field.name)
parameters[1].filters[1].list = mylist
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
"""The source code of the tool."""
try:
# Some code to show that I had managed to get what I wanted intot the ValueTable
data = parameters[1].values
arcpy.AddField_management(parameters[0].value, "Source", "TEXT", "", "", "75", "", "NULLABLE", "NON_REQUIRED", "")
arcpy.AddField_management(parameters[0].value, "DateUpdate", "DATE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
arcpy.AddField_management(parameters[0].value, "Effective", "DATE", "", "", "", "", "NULLABLE", "NON_REQUIRED", "")
search = 'Source'
for sublist in data:
if sublist[0] == search:
final = sublist
mysource = final[1]
sourceData = "[" + mysource + "]"
arcpy.CalculateField_management(parameters[0].value, "Source", sourceData, "VB", "")
break
except arcpy.ExecuteError:
messages.addErrorMessage(arcpy.GetMessages()) In line 75 I add the "Source" field and in line 84 I try to calculate it, but I get the error that the "Source" field does not exist. Any help would be appreciated. Tim
... View more
04-14-2017
06:05 AM
|
0
|
10
|
3559
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-06-2015 06:58 AM | |
| 1 | 05-04-2016 07:27 AM | |
| 1 | 07-06-2017 08:12 AM | |
| 1 | 10-26-2015 11:51 AM | |
| 1 | 12-12-2014 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|