POST
|
Just confirming that removing XTools Pro (installed by default with all instances of AGP in my agency) resolved the problem for me. Is there a bug number so we can track this?
... View more
05-10-2023
09:21 AM
|
3
|
1
|
1170
|
POST
|
Ah, this is a better solution than mine. My search-fu failed me when I was looking for such a tool.
... View more
04-10-2023
10:07 AM
|
0
|
1
|
676
|
POST
|
I think you need to do this with python. I asked ChatGPT: import arcpy
# Set the input feature class
input_fc = r"path\to\your\feature\class"
# Create an arcpy.da.UpdateCursor to iterate through each row in the feature class
with arcpy.da.UpdateCursor(input_fc, ["SHAPE@"]) as cursor:
for row in cursor:
# Get the geometry of the current row
line = row[0]
# Create an empty array to hold the updated vertex coordinates
new_vertices = arcpy.Array()
# Iterate through each part of the line
for part in line:
# Create an empty array to hold the updated part vertices
new_part = arcpy.Array()
# Iterate through each vertex in the part
for vertex in part:
# Get the z-value of the current vertex in meters
z_meters = vertex.Z
# Convert the z-value to feet
z_feet = z_meters * 3.28084
# Create a new Point object with the updated z-value in feet
new_vertex = arcpy.Point(vertex.X, vertex.Y, z_feet)
# Append the new vertex to the updated part
new_part.append(new_vertex)
# Append the updated part to the array of updated vertices
new_vertices.append(new_part)
# Create a new Polyline object with the updated vertex array
# For the record, ChatGPT forgot to add the has_z argument below. It's not perfect!
new_line = arcpy.Polyline(new_vertices, has_z=True)
# Update the geometry of the current row with the new geometry
row[0] = new_line
# Update the cursor to save the changes to the current row
cursor.updateRow(row) I did a quick test and it worked for me. I ran it from a Notebook in my Pro project
... View more
04-06-2023
02:49 PM
|
0
|
1
|
704
|
POST
|
Sorry, not quite. I am not trying to track down the objectid of an offending feature (that would be DestID), but the DestClassID of the line feature class that should be covering the boundaries of polygons in OriginClassID. And it's important because a polygon feature class can have that rule listed more than once in a Topology where for each occurrence a different line feature class is specified. If I want to inspect Line Errors and see if the rule has been violated for just one feature class, I need to see DestClassIDs listed. The Error Inspector knows what the DestClassID because it shows the appropriate line feature class in column Feature 2. Why isn't that information listed in Line Errors?
... View more
04-06-2023
02:09 PM
|
1
|
1
|
268
|
POST
|
I have a topology where one rule is polygon boundaries in MapUnitPolys must be covered by lines in ContactsAndFaults. When viewing the Error Inspector dialog to look at violations to this rule, both feature classes that participate in this rule are shown: But when I view the same information in the 'Line Errors' table, only the OriginClassID of the origin feature class is shown: Here, TopoRuleID 37 is the id for the 'Boundary Must Be Covered By' rule and OriginClassID 4 is my MapUnitPolys feature class. On row 2, I would expect the DestClassID of ContactsAndFaults, 47, to be shown, but what's there is 0. Is this the expected behavior? I am trying to script the reading of the various topology tables, but if they are incomplete, I'll need to do something else. ArcGIS Pro 3.0.3
... View more
03-28-2023
05:11 PM
|
0
|
3
|
338
|
POST
|
Good question! One of my biggest complaints about Pro (the lack of context-menu options, not XY Event Layer specifically) If you need the tool frequently, you could customize the ribbon or add the tool to the Quick Access Toolbar.
... View more
07-07-2022
03:28 PM
|
1
|
0
|
374
|
POST
|
I might be missing the details of what you want to do, but it sounds like after selecting a layer you could either call the Calculate Field tool or run through rows with an Update Cursor. And you have posted your question in the ArcGIS Pro forum. You might delete the post and re-post your question in ArcMap Questions - Esri Community
... View more
07-07-2022
03:17 PM
|
2
|
0
|
171
|
POST
|
Ah! census geographic identifiers, not globe models, right? I set up a table with the following fields and datatypes and then wrote an 11 character census tract to geoid_string, 48201223100 Running the field calculation int(!geoid_string!) on each of the fields resulted in: I am guessing you are trying to calculate on a long integer field? Try setting it to double and using the calculation above. Read more about the limits on datatypes here: ArcGIS field data types—ArcGIS Pro | Documentation
... View more
07-07-2022
03:02 PM
|
0
|
0
|
320
|
POST
|
Probably the easiest way to create a spatialReference object is to pull it from another item, such as a map or layer, as you have done in your example, but you can also create one from a .prj file, the name, or factory code and you don't need to use loadFromString. From the documentation: sr = arcpy.SpatialReference("Hawaii Albers Equal Area Conic") You would only need loadFromString if you only had the WKT string.
... View more
06-28-2022
11:13 AM
|
0
|
0
|
870
|
POST
|
Get a handle on the map object and there is a spatialReference property you can read and write to Map—ArcGIS Pro | Documentation I was able to determine this was available at least as late as v2.6, but older than that, I don't know
... View more
06-22-2022
11:14 AM
|
0
|
2
|
934
|
POST
|
Thanks, Dan. Yeah, I don't really know how to use that information. One module that I know is causing problems, in that it was not available for someone with 2.6, is lxml, which is not listed on either of those lists at all, so I don't know what to make of that. I looked around for some .yaml files for previous versions but only found one for 2.1. Guess I will just have to rely on reports from users.
... View more
06-13-2022
12:50 PM
|
0
|
0
|
375
|
POST
|
Is there a place where the packages included in the conda distribution for each version of ArcGIS Pro are listed? I nearly always have the latest version of Pro and as I write tools against that I want to be able to provide documentation about the packages that won't be available at previous versions.
... View more
06-10-2022
10:16 AM
|
1
|
2
|
431
|
POST
|
I would like to measure the volumes of some features in the ESRI Terrain image service, which seems like it should be possible with the 3D mensuration tool 'Volume' on the Imagery tab, given what I have read about it. But the tools are disabled whether I set Elevation (in the Mensuration Options dialog) as the image service or a locally saved clip from it. What am I missing?
... View more
10-25-2021
01:17 PM
|
1
|
4
|
1139
|
POST
|
Thanks, Johannes. I presume you mean to put the try/except block in the Notebook? That would work, but it's not the behavior I am trying to produce for the case where another user picking up my tools provides the wrong parameters in a Notebook. They would have to write that block themselves and call the docstring. The problem I think I am coming up against in doing my own validation is that if I mark a parameter as being required, regardless of what I put in updateMessages, the internal validation still has to warn the user that a required parameter was not provided. I can't circumvent that. Maybe it would be possible to use a try/except block in def execute but I have not found any evidence that anything inside of def execute gets run if the internal validation fails. It looks to me like it simply does not get called. Not to mention that that would require sending an empty parameter list to my tool script, have that fail, and then come back to the except statement. Not very efficient. I have also tried exiting and quitting in def updateMessages if my parameter list is empty, but I still get an ExecuteError.
... View more
10-12-2021
03:45 PM
|
0
|
0
|
471
|
POST
|
I am working with custom tools in a Python Toolbox inside an ArcGIS Notebook. When a user provides either no parameters or the wrong parameters for a tool, I would like to display my own docstring; the same one that would be displayed in the terminal if the tool was being called from the command line (I import my tool from an external script file), INSTEAD of the ExecuteError messages that get displayed. I have worked out a process to get my docstring printed, and that does, at least, appear above the ExecuteError message block, but I can't get rid of the other messages. True, I want this mostly for aesthetic reasons, but also, the line numbers listed in the traceback are confusing because they don't all actually indicate the lines of code in my script that are throwing the error. Right now, I can display the docstring if I check for valid parameters in def updateMessages, but def execute still gets called. So, one solution would be if I could jump out of the python toolbox code before def execute is run. The other thing might be somehow removing the ExecuteError messages from the messages object ? My Notebook cells, when no parameters are provided, look like this: You can see my docstring, starting with "Usage:", is then followed by the ugly and less readable ExecuteError message block. And the relevant part of the .pyt looks like this: def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
parameter_values = [parameter.valueAsText for parameter in parameters]
if parameters[0].valueAsText is None:
import tool1
importlib.reload(tool1)
print(tool1.main.__doc__)
return
def execute(self, parameters, messages):
"""The source code of the tool."""
import tool1
importlib.reload(tool1)
parameter_values = [parameter.valueAsText for parameter in parameters]
if parameter_values[0] == 'broccoli':
print(tool1.main.__doc__)
else:
tool1.main(parameter_values)
return Also, I need a solution that doesn't bork the functionality of the tool when opened in the Geoprocessing pane, that is, with the parameter form. For instance, I could make all of my parameters optional, which would pass internal validation and then allow me to do my own validation inside def execute (my if statement near the bottom of my code is an example of how this might be done), but that messes with the functionality of the form.
... View more
10-07-2021
11:08 AM
|
0
|
2
|
528
|
Title | Kudos | Posted |
---|---|---|
1 | 10-25-2021 01:17 PM | |
3 | 05-10-2023 09:21 AM | |
1 | 04-06-2023 02:09 PM | |
1 | 07-07-2022 03:28 PM | |
2 | 07-07-2022 03:17 PM |
Online Status |
Offline
|
Date Last Visited |
02-06-2024
01:32 PM
|