POST
|
@EugenioArima and @MohandKETTOUCHE Thank you! I was able to fix it with MohandKETTOUCHE's method and EugenioArima's directory guidance. Cheers.
... View more
02-11-2022
10:18 AM
|
1
|
0
|
675
|
POST
|
Thanks for your reply @ChristopherPawlyszyn. Unfortunately, restoring the datastore failed for similar reasons as well, which is a major bummer because I had a restore point from the night before. For those who read this post in the future who have a lot of data out there to lose, I do NOT recommend my plan of action, at least not without contacting tech support first. PLEASE TAKE THE RECOMMENDED action of calling support before taking my own, more destructive path if you have anything of worth at stake. Fortunately for me, the portal only had 11 hosted feature services in it, and 9 of them were scripted. I ended up just uninstalling and reinstalling data store which fixed the issue. I did have to rebuild the services as a result, which didn't take too long for me luckily.
... View more
12-02-2020
05:33 AM
|
1
|
0
|
6804
|
POST
|
Hi all, I'm currently running into issues configuring data store on 10.8.1. Note that everything started when the primary (and only) relational datastore failed to validate. When running the configuredatastore tool, everything initializes and runs for a minute or so before failing with error message: Error encountered: Machine 'https://localhost:2443/arcgis/datastoreadmin' returned an error. 'Attempt to configure data store failed Caused by: Attempt to configure data store failed. Caused by: Attempt to configure data store failed. Caused by: Null' Performing the same function through the browser UI produces the same result. For some added context: Both tile cache and relational data store were installed and configured on the same machine, working great as of yesterday around 1PM. Received notification at 6PM that none of the hosted feature services are working (tile cache was), and I ended up unregistering from server with hopes of re-registering only to ultimately end up failing with a reconfigure as described above. Error messages for both restore and re-register have produced "Token Required" errors. Anyone run into this before or have any thoughts on this?
... View more
11-25-2020
09:03 PM
|
1
|
3
|
6873
|
POST
|
Thank goodness, I was able to remedy this problem (kind of) fairly easily once I dug around the geoprocessing package for a long while. After you add the downloaded geoprocessing package to your project, a folder is created that contains around 5 versions of your toolbox at about 3 different folder levels. The default path to find the one I wanted to use (with blank parameters and full validation functionality on load), for me, was something along the lines of C:\Users\*USER NAME*\Documents\ArcGIS\Packages\*NAME OF TOOL FOLLOWED BY A BUNCH OF CHARACTERS*\p12\*Folder name of original script*\*NAME OF TOOLBOX*. I included this default link schema within a "Read Me" file to direct the new users to it when adding the toolbox. Had a colleague go through the read me file and add the link, and it worked like a charm. Annoying, but it's a way to get it to work the way I needed it to. Note that if you don't want people to access your source code, you need to be sure to password protect it.
... View more
07-25-2019
02:01 PM
|
0
|
0
|
420
|
POST
|
Hi all, I recently created a "Geodatabase append" tool which, in a nutshell, batch process-appends all feature classes within a specified input geodatabase to a target "master" geodatabase, plus some optional functionality which deletes fields within the Master GDB prior to the append. The tool works great in ArcGIS pro, but I'm seeking a way to publish ONLY the tool to portal (not the dataset or reference to the dataset represented in the geoprocessing history). I've tried only uploading the schema, I've tried setting self.params .value to empty all parameters upon initialization, and nothing seems to work. Has anyone been able to successfully do this? In general, validation has been very tricky for me to get a handle on... but my code can be found below. If there's a general process answer or a script-based answer, I'd be open to both. I realize this might sound like a cryptic question to some, so if I need to elaborate I'd be happy to. I'm hoping that I'm just a big dummy that overlooked something in my process to reach the desired result... but I digress. My validation code can be found below, if it helps. Thanks in advance for any help! Here's what I want to happen on load: Here's what happens when I open the Published version: Or when I open the Schema Only Published version: Validation Code: import arcpy
class ToolValidator(object):
"""Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog."""
def __init__(self):
"""Setup arcpy and the list of tool parameters."""
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
"""Refine the properties of a tool's parameters. This method is
called when the tool is opened."""
# Thought I had to throw this in the the published version to clear fields, but
# this didn't work to clear either
self.params[0].value = ""
self.params[1].value = ""
self.params[2].value = ""
self.params[3].value = ""
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
# Lots of syntax not related to this post
# A "hide" function which works only in the original script tool, not the
# published versions
if self.params[2].value:
self.params[3].enabled = True
else:
self.params[3].enabled = False
def updateMessages(self):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
... View more
07-24-2019
10:50 AM
|
0
|
1
|
537
|
POST
|
Hi Rory, I have unmarked the "Correct" answer as I'm still seeking a python-only option. I have had success getting the workaround to function, but only using very specific naming mechanisms. No updates as of yet, but I just wanted to let you know that I'm still in the weeds on this one and will post once I find a more robust solution. Or even better, hopefully someone who knows more about what they're doing than I do posts a solution!
... View more
03-12-2019
01:17 PM
|
0
|
2
|
4077
|
POST
|
Ugh, I'm not sure what the hangup is. The syntax above works, but similarly to the previous examples it only works if I manually enable the map series from the ArcGIS Pro UI first. I'm using the same python and ArcGIS Pro versions that you stated. Looks like I have some troubleshooting to do. Thanks for your help, if you have any other insights I'm all ears. In the meantime I'll try to work a solution and post if I find one. ****UPDATE**** I was not able to resolve this issue using Python, but I was able to workaround it by enabling the Layout Map Series using the ArcGIS Pro interface prior to running any scripts. Saving the Layout with MapSeries enabled carried over to the import process used within the script. This worked every time I ran it across multiple sessions and using multiple projects. I'm hoping to find a way to manually write the "enabled" property in the future, though.
... View more
02-26-2019
12:38 PM
|
1
|
0
|
4077
|
POST
|
Thanks for your response, Mitch. When I run my original script in its entirety, I don't receive any errors, but nothing happens with regard to the mapseries script (I'm assuming because the "if not" statement didn't have an "else" statement following it). Running your lines of code produces the same result -- the script still seems to hit a dead end and l.mapSeries still equates to "None" (generated in the Python window) if not l.mapSeries is None:
ms = l.mapSeries
if ms.enabled:
ms.exportToPDF(r"C:\EsriPress\Ex3_SelectedFeatures.pdf", "ALL", "", "PDF_SINGLE_FILE", 150, "BEST", True, "ADAPTIVE", True, "LAYERS_ONLY", True, 80, True, False)
else:
ms.enabled = True
ms.exportToPDF(r"C:\EsriPress\Ex3_SelectedFeatures.pdf", "ALL", "", "PDF_SINGLE_FILE", 150, "BEST", True, "ADAPTIVE", True, "LAYERS_ONLY", True, 80, True, False)
print(l.mapSeries)
None I also tried altering indentation so the "else" statement aligns with the "if not", which does generate the following traceback error (see below): if not l.mapSeries is None:
ms = l.mapSeries
if ms.enabled:
ms.exportToPDF(r"C:\EsriPress\Ex3_SelectedFeatures.pdf", "ALL", "", "PDF_SINGLE_FILE", 150, "BEST", True, "ADAPTIVE", True, "LAYERS_ONLY", True, 80, True, False)
else:
ms.enabled = True
ms.exportToPDF(r"C:\EsriPress\Ex3_SelectedFeatures.pdf", "ALL", "", "PDF_SINGLE_FILE", 150, "BEST", True, "ADAPTIVE", True, "LAYERS_ONLY", True, 80, True, False)
Traceback (most recent call last):
File "<string>", line 6, in <module>
AttributeError: 'NoneType' object has no attribute 'enabled' So is the hangup here that we need syntax not only to enable the mapseries, but also to inject any required properties? For example, the ArcGIS Pro tool dialogue insinuates that the map frame, layer, name field, sort field are all required. Thoughts?
... View more
02-26-2019
08:30 AM
|
0
|
2
|
4077
|
POST
|
Hi there, please bear with me as this is my first post and I'm relatively new to Python. I'm currently constructing a tool which would create and export a map series. So far I've been able to create a strip map index, import a layout, and even export the series to PDF -- but only after I manually enable the mapseries from arcgis pro. How do I go about authoring the map series using python? Thanks in advance if you're able to help with this. Code can be found below. # All of this code works
import arcpy
arcpy.env.workspace = r"somepath"
prodoc = arcpy.mp.ArcGISProject("CURRENT")
prodocmap = prodoc.listMaps("Map")[0]
feature_selection = arcpy.CopyFeatures_management("test_line", r"memory\erased")
scale = 24000
horiz_line_buffer = "8.5 inches"
vert_line_buffer = "5.5 inches"
strip_map = arcpy.StripMapIndexFeatures_cartography (feature_selection, "grid1", "USEPAGEUNIT", scale, horiz_line_buffer, vert_line_buffer, "HORIZONTAL", 0, "", "WE_NS")
arcpy.Delete_management ("erased")
prodoc.importDocument(r"layoutpath.pagx")
import arcpy
import os
import sys
relpath = os.path.dirname(sys.argv[0])
p = arcpy.mp.ArcGISProject("CURRENT")
l = p.listLayouts()[0]
mf = l.listElements("MAPFRAME_ELEMENT")[0]
first_map = p.listMaps()[0]
# Need to inject mapSeries enable or similar here, can't get it to work
# export mapseries as PDF - This Works
if not l.mapSeries is None:
ms = l.mapSeries
if ms.enabled:
ms.exportToPDF(r"C:\EsriPress\Ex3_SelectedFeatures.pdf", "ALL", "", "PDF_SINGLE_FILE", 150, "BEST", True, "ADAPTIVE", True, "LAYERS_ONLY", True, 80, True, False)
... View more
02-26-2019
06:25 AM
|
0
|
11
|
5447
|
Title | Kudos | Posted |
---|---|---|
1 | 02-11-2022 10:18 AM | |
1 | 11-25-2020 09:03 PM | |
1 | 12-02-2020 05:33 AM | |
1 | 02-26-2019 12:38 PM |
Online Status |
Offline
|
Date Last Visited |
02-11-2022
11:50 AM
|