|
POST
|
The Pro geoprocessing system has this neat feature buried in the docs where you can create standard Python packages that contain script tools, then install those packages to your current environment with the accompanying toolbox infrastructure. More info here. The docs use a Python toolbox in their examples but there's mentions of supporting standard toolboxes as well, most notably in the introduction to the page I linked. However, when I build a package with a standard toolbox and then install it, attempting to run the tool in Pro 3.0.1 results in this error: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\JDangermont\AppData\Local\ESRI\conda\envs\testing\Lib\site-packages\foo\esri\arcpy\SampleToolbox.py", line 20, in SampleTool
raise e
File "C:\Users\JDangermont\AppData\Local\ESRI\conda\envs\testing\Lib\site-packages\foo\esri\arcpy\SampleToolbox.py", line 17, in SampleTool
retval = convertArcObjectToPythonObject(gp.SampleTool_SampleToolbox(*gp_fixargs((), True)))
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 510, in __getattr__
val = getattr(self._gp, attr)
AttributeError: Object: Tool or environment <SampleTool_SampleToolbox> not found This could be some weird misconfiguration or environment problem on my end so I've attached a little package that you can download, build, and add to your testing environment. You can build the package using the standard instructions, install it with pip, relaunch Pro and then run arcpy.SamplePythonToolbox.SampleTool() and arcpy.SampleToolbox.SampleTool() from the Python window. If the first tool succeeds but the second tool fails then it's safe to say atbx files aren't actually compatible with this packaging system. If so I hope someone from esri can dig into this as it's most likely just an issue with the autogenerated wrapper code.
... View more
09-21-2022
11:52 AM
|
0
|
0
|
618
|
|
POST
|
My general rule for writing script tools is to structure them like this: def main(param0, param1, param2):
return doSomethingWith(param0) + doOtherThingWith(param1 + param2)
if __name__ == "__main__":
param0 = arcpy.GetParameterAsText(0)
param1 = arcpy.GetParameterAsText(1)
param2 = arcpy.GetParameterAsText(2)
param3 = main(param0, param1, param2)
arcpy.SetParameterAstext(3, param3) This has two big benefits. First, you ensure all the parameters are yanked out of the aether and loaded into proper variables before you run your task. Second, you now have a main function that isn't strictly dependent on parameter state, which means you can write tests for it or call the function from other scripts without going through importing a toolbox.
... View more
09-21-2022
11:13 AM
|
1
|
0
|
3029
|
|
POST
|
If you're willing to dive into arcpy cursors and geometry objects you should be able to find a way to load in lines, generate points at set intervals along said line and then load those points into a feature class. There might be a stock geoprocessing or editing tool we're both missing but if you like solving little programming challenges this seems worth digging into.
... View more
09-15-2022
04:14 PM
|
0
|
0
|
2562
|
|
POST
|
It looks like the only exit point that can return a null value is the final return for the address itself. You can coerce a null address to your string like so: var address = closestFeatureWithDistance['feature']['Address']
return Iif(IsEmpty(address), "Not Detected", address) I think the issue is you're checking if the entire "closestFeatureWithDistance" object is null on line 33 rather than just the Address attribute.
... View more
09-15-2022
10:47 AM
|
1
|
1
|
1351
|
|
POST
|
Attribute Rules sound like the clear answer here, you can get started at this link. If your datasets need to remain accessible in ArcMap then this is off the table, 2 things you can try are: Using the new Field Maps arcade functionality to calculate the attributes client-side (link). This'll only work if your only point of entry to the data is through Field Maps. Create database triggers in your RDBMS if available. This is a very fragile process as anything that changes the underlying table structure (such as enabling versioning) will break your triggers and you may have to write some complex SQL to keep the tables in line, but this'll work across the board.
... View more
09-15-2022
10:41 AM
|
0
|
1
|
5730
|
|
POST
|
Try and reduce your workflow down to something that's easy to replicate and try to make it happen again. If you can reliably delete records just by using the join commands then you need to take this to your support contact as this could be a major regression in Pro, or at least signs that something in your environment is acting up.
... View more
09-15-2022
10:18 AM
|
1
|
0
|
3070
|
|
IDEA
|
Quoting the latest docs: For layers in the feature service that can store attachments, the Create or Update operation allows editors of the feature service to add an attachment to a feature. The Update operation further enables editors to update or delete an attachment that is associated with a feature. If only the Delete operation is enabled, editors can delete attachments. I can't think of a single scenario where the user would be forbidden from deleting a feature, but should be able to delete that feature's attachments. Please align the attachment permissions with the feature permissions so that users must have delete permissions to delete attachments.
... View more
09-02-2022
08:44 AM
|
9
|
3
|
1961
|
|
POST
|
One thing you can try first is to add "?f=json" to the end of your URL, this should return the resource's JSON definition. I've encountered a lot of ArcGIS Server sites that forbid HTML viewing but are fine with JSON, you might be in the same boat.
... View more
08-25-2022
05:04 PM
|
0
|
0
|
956
|
|
POST
|
If you're rendering the map in Pro, you can go to the Map's properties and fiddle with the Clip Layers section. This'll create a clip mask that you can apply to layers, including the output of the Heat Map symbology. Here's an example of what this looks like from a layout I made: If you don't have Pro or you have the heat map as a raster then you'll need a tool that can clip rasters, not sure what the workflow is there.
... View more
08-25-2022
05:01 PM
|
0
|
0
|
1505
|
|
POST
|
Has anyone found a working setup for script tool debugging with Pro 3.0 and VS2022? I'm following the steps from the usual guide which worked fine with Pro 2.9 and VS2019 but nothing seems to be working right now. I was able to get an exception caught at one point but I haven't been able to replicate it after a dozen attempts. I don't have VS2019 on hand so I can't test if it's just an issue with VS2022 but I'd hope the version of Pro built on the latest .NET release would also support the current Visual Studio.
... View more
08-05-2022
03:18 PM
|
1
|
1
|
1517
|
|
POST
|
"import issues and third party libraries" piques my interest. I'm pretty sure when you have both runtimes installed on your server site you have two Python installations as well. If you installed packages and .pth files to your ArcMap Python directories you'll have to do the same process to your Pro Python directory (using the 3.x version of the packages of course). If that doesn't fix it I'd give your support rep a call, these sorts of issues are hard to solve without someone poking around your server machines.
... View more
07-28-2022
09:26 AM
|
0
|
1
|
2490
|
|
POST
|
If you have a DBA they would create the view and register it with the EGDB so you can work with it in Pro. They'd presumably have the knowledge to create a table view with an extra identity field for whatever your DB provider is. This requires creating a new view in the DB but it won't interfere with important processes so they hopefully won't have any issues with your request. If both tables in your join are in the same DB, another thing you can try is creating a Query Layer. That way you can join your tables together without worrying about what Pro uses as the ObjectID.
... View more
07-28-2022
09:13 AM
|
0
|
0
|
6561
|
|
IDEA
|
Please add the ability to export toolbox parameter definitions to the format used in Python toolboxes. I'd love to migrate my tools to Python toolboxes but I'm having difficulties working with parameter definitions. Editing these items in a regular toolbox and then exporting them to Python would greatly speed up the development process when using Python toolboxes.
... View more
07-18-2022
03:31 PM
|
2
|
0
|
752
|
|
IDEA
|
This exact thing caught me by surprise when I switched over to Pro, I think a quick pass through the localization files is well worth avoiding confusion from ArcMap converts.
... View more
07-08-2022
10:51 AM
|
0
|
0
|
4990
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-24-2023 11:47 AM | |
| 2 | 04-09-2026 11:36 AM | |
| 1 | 09-08-2023 10:07 AM | |
| 3 | 03-26-2026 08:11 AM | |
| 2 | 03-12-2026 01:41 PM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|