POST
|
Thanks! I was looking at the Parameter documentation and didn't think to look at the more general toolbox documentation, so I missed that. We'll just move forward without that.
... View more
09-08-2023
04:28 PM
|
0
|
0
|
283
|
POST
|
Hi all, I'm building a python toolbox and getting a weird error when trying to set a parameter's displayName in the updateParameters function. I have a working version where it enables and disables parameters, but I get the following error. I know what this means, but the documentation indicates that the displayName attribute should be read/write for a parameter object. Error 000001 Traceback (most recent call last): File "<string>", line 228, in updateParameters AttributeError: ParameterObject: Set attribute: displayName does not exist Line 228 is the following, but I get the error for any of the parameters[].displayName lines: parameters[5].displayName=param_settings["Stands"] Here is the relevant code. I would really appreciate any ideas! class StandsOnBuffers_Update(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Update StandsOnBuffers"
self.description = "Creates StandsOnBuffers for update process"
self.canRunInBackground = False
self.category = "Update"
def getParameterInfo(self):
"""Define parameter definitions"""
procws_param = arcpy.Parameter(
displayName="Processing Workspace",
name="Processing_Workspace",
datatype="DEWorkspace",
parameterType="Required",
direction="Input")
#param0.displayOrder = 0
cf_param = arcpy.Parameter(
displayName="Configuration File",
name="Configuration_File",
datatype="DEFile",
parameterType="Required",
direction="Input")
cf_param.filter.list=['json']
#param1.displayOrder = 2
outws_param = arcpy.Parameter(
displayName="Output Workspace",
name="Output_Workspace",
datatype="DEWorkspace",
parameterType="Required",
direction="Input")
#param2.displayOrder = 3
rn_param = arcpy.Parameter(
displayName="Run Name",
name="Run_Name",
datatype="GPString",
parameterType="Required",
direction="Input")
#param3.displayOrder = 4
reg_param = arcpy.Parameter(
displayName="Region",
name="Region",
datatype="GPString",
parameterType="Required",
direction="Input")
reg_param.filter.type="ValueList"
reg_param.filter.list=["SEUS","SWUS","NWUS"]
#param4.displayOrder = 5
st_param = arcpy.Parameter(
displayName="Stands from previous run",
name="Stands",
datatype="DEFeatureClass",
parameterType="Optional",
direction="Input")
#param5.displayOrder = 6
arws_param = arcpy.Parameter(
displayName="Archive Workspace",
name="Archive_Workspace",
datatype="DEWorkspace",
parameterType="Required",
direction="Input")
own_param = arcpy.Parameter(
displayName="Ownership from previous run",
name="Ownership",
datatype="DEFeatureClass",
parameterType="Optional",
direction="Input")
rdwarma_param = arcpy.Parameter(
displayName="Road Water RMA Buffers",
name="Road_Water_RMA_Buffers",
datatype="DEFeatureClass",
parameterType="Required",
direction="Input")
dmgst_param = arcpy.Parameter(
displayName="Damaged Stands",
name="Damaged_Stands",
datatype="DEFeatureClass",
parameterType="Optional",
direction="Input")
dmgst_param.enabled = False
params = [procws_param,outws_param,arws_param,cf_param,reg_param,st_param,own_param,rdwarma_param,dmgst_param,rn_param]
return params
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
if parameters[3].altered:
with open(parameters[3].valueAsText,'r') as f:
config = json.load(f)
param_settings = config["Parameters"]
if "Stands" in param_settings:
if isinstance(param_settings["Stands"],str):
parameters[5].enabled=True
parameters[5].displayName=param_settings["Stands"]
else:
parameters[5].displayName="Stands from previous run"
parameters[5].enabled=param_settings["Stands"]
if "Ownership" in param_settings:
if isinstance(param_settings["Ownership"],str):
parameters[6].enabled=True
parameters[6].displayName=param_settings["Ownership"]
else:
parameters[6].displayName="Ownership from previous run"
parameters[6].enabled=param_settings["Ownership"]
if "DamagedStands" in param_settings:
if isinstance(param_settings["DamagedStands"],str):
parameters[8].enabled=True
parameters[8].displayName=param_settings["DamagedStands"]
else:
parameters[8].displayName="Damaged Stands"
parameters[8].enabled=param_settings["DamagedStands"]
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
if parameters[5].enabled:
if parameters[5].value and arcpy.Exists(parameters[5].valueAsText):
parameters[5].clearMessage()
else:
parameters[5].setIDMessage("ERROR",530)
if parameters[6].enabled:
if parameters[6].value and arcpy.Exists(parameters[6].valueAsText):
parameters[6].clearMessage()
else:
parameters[6].setIDMessage("ERROR",530)
if parameters[8].enabled:
if parameters[8].value and arcpy.Exists(parameters[8].valueAsText):
parameters[8].clearMessage()
else:
parameters[8].setIDMessage("ERROR",530)
return
def execute(self, parameters, messages):
"""The source code of the tool."""
arcpy.env.overwriteOutput = True
#with open(debugLogPath,'w') as debugLog:
for param in parameters:
if not param.enabled:
param.value=None
#debugLog.write("{}:{}\n".format(param.name,param.valueAsText))
StandsOnBuffers(parameters[0].valueAsText,parameters[1].valueAsText,parameters[2].valueAsText,parameters[3].valueAsText,parameters[4].valueAsText,parameters[5].valueAsText,parameters[6].valueAsText,parameters[7].valueAsText,parameters[8].valueAsText,parameters[9].valueAsText)
return
def postExecute(self, parameters):
"""This method takes place after outputs are processed and
added to the display."""
return
... View more
09-08-2023
08:22 AM
|
0
|
2
|
357
|
POST
|
The policy disables it, so removing that policy enables it.
... View more
07-29-2022
08:38 AM
|
0
|
0
|
1992
|
POST
|
We think we found the setting that is causing this bug. We went through all of our GPO rules and when we removed the one under System Services to disable the Touch Keyboard and Handwriting Panel Service on startup, it fixed the issue. I'm sharing that with ESRI, but maybe it will help some of the other people on this thread.
... View more
07-28-2022
07:55 PM
|
7
|
5
|
4338
|
POST
|
I had this logged as BUG-000143558 on 10/7/2021. It is still marked as "In Review." I'm very disappointed with ESRI's lack of concern over this issue that has been a real show stopper for us.
... View more
06-30-2022
07:49 AM
|
2
|
0
|
2140
|
POST
|
BUG-000143558 is the one that I initially logged with ESRI. We don't use Kaspersky and the Touch Keyboard and Handwriting Panel service has been disabled, so neither one is a magic fix. Reading through this thread, I agree with @DanielMcIntyre that it likely has to do with the interaction between Pro and certain NVIDIA drivers, especially the Grid drivers. We are using the older T4 cards, so it's a little disheartening to read that the issue exists with the A40 cards as well. I'm hoping Pro 3.0 fixes this bug because this has been a show stopper for us that leaves us stuck on 2.7.
... View more
06-08-2022
09:16 AM
|
0
|
1
|
1071
|
POST
|
Did you ever find a resolution to this issue? I have encountered the same issue in our environment and have tried a full uninstall, deleted profile, etc. and continue to have the same issue.
... View more
09-02-2021
08:23 AM
|
0
|
3
|
3965
|
BLOG
|
When will the video be available to watch as a non-live stream? The JDI presentation was excellent and I want to point some of our resources analysts and technical director to it.
... View more
07-09-2018
09:37 AM
|
6
|
0
|
5282
|
POST
|
If it has an empty output and doesn't even have the "this is before arcpy" line in the text file, then it's not an arcpy/Pro issue. Check the permissions on the python folders and the output folders. Try logging into the machine as the user that it is scheduled to run as instead of your own user and see if the script works then. That will help narrow down the issue.
... View more
06-30-2017
08:36 AM
|
0
|
0
|
997
|
POST
|
Just glancing at that code, you probably are getting an empty output because it never runs the f.close() line if there is an error. Try this instead: f = open("c:/temp/output.txt", 'w')
f.write("this is before arcpy \n")
try:
import arcpy
f.write("arcpy imported\n")
except Exception as e :
f.write(str(e))
finally:
f.close()
... View more
06-29-2017
12:59 PM
|
0
|
2
|
997
|
POST
|
We are working to get our lower level users away from desktop installations and into a web interface. Our problem is that the Web Appbuilder editing widget doesn't have the functionality that we need and the user experience is a bit clunky on top of that. I could easily write a custom widget that would solve a lot of our issues, but we want to stay away from custom development because we want the long-term support that comes with commercial products. We are running ArcGIS Server, Portal, and using SQL Server as the back end. Anyone have any suggestions for 3rd party software to handle this? Some of our needs that are not handled by the Web Appbuilder: 1. Tracing 2. Copy and paste features between layers 3. Annotation and dimension editing (less important than others) Thanks in advance!
... View more
06-16-2017
09:52 AM
|
1
|
0
|
410
|
BLOG
|
Even when using Windows authentication with Portal, it won't let me federate an ArcGIS Server that does not use built in roles.
... View more
05-04-2017
02:14 PM
|
1
|
0
|
5168
|
BLOG
|
It also seems that you can't federate Portal with ArcGIS Server if you use Windows Active Directory authentication instead of built in.
... View more
05-04-2017
12:03 PM
|
0
|
0
|
5168
|
Title | Kudos | Posted |
---|---|---|
7 | 07-28-2022 07:55 PM | |
2 | 06-30-2022 07:49 AM | |
6 | 07-09-2018 09:37 AM | |
1 | 06-16-2017 09:52 AM | |
1 | 05-04-2017 02:14 PM |
Online Status |
Offline
|
Date Last Visited |
a month ago
|