POST
|
Hi, Environment: ArcGIS Pro 3.2.1, ArcGIS Enterprise 11.1 I published a geoprocessing tool which converts AutoCAD .dwg file to .geojson format. When i try to run it from WebApp Builder or Portal Map viewer classic, It throughs below error. It worked fine on ArcGIS Pro desktop, with no issues " Traceback (most recent call last): File "", line 99, in execute File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\conversion.py", line 2169, in CADToGeodatabase raise e File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\conversion.py", line 2166, in CADToGeodatabase retval = convertArcObjectToPythonObject(gp.CADToGeodatabase_conversion(*gp_fixargs((input_cad_datasets, out_gdb_path, out_dataset_name, reference_scale, spatial_reference), True))) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Output Geodatabase: Dataset C:\Users\PRODGI~1\AppData\Local\Temp\tmp2vw9kb42 \\networkfiles\location\arcgisserver\directories\arcgissystem\arcgisinput\others\Tool1.GPServer\extracted\p30\..\cd\shapefile_datatemp.gdb does not exist or is not supported Failed to execute (CADToGeodatabase). Failed to execute (DWGtoGEOJSON_Stage1). Failed. " # -*- coding: utf-8 -*-
import arcpy
import os
import tempfile
import os.path
import shutil
class Toolbox:
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the
.pyt file)."""
self.label = "toolbox"
self.alias = "toolbox"
# List of tool classes associated with this toolbox
self.tools = [Tool]
class Tool:
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "DWGtoGEOJSON_Stage1"
self.description = ""
def getParameterInfo(self):
"""Define the tool parameters."""
params = [
arcpy.Parameter(displayName="Input_CAD_File",
name="in_cad",
datatype="DEFile",
parameterType="Required",
direction="Input"),
arcpy.Parameter(displayName="Output GEOJSON File",
name="out_geojson",
datatype="DEFile",
parameterType="Required",
direction="Output")
]
return params
def isLicensed(self):
"""Set whether the 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."""
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."""
in_cad = parameters[0].valueAsText
out_geojson = parameters[1].valueAsText
temp_dir = tempfile.mkdtemp()
temp_gdb = "temp.gdb"
arcpy.CreateFileGDB_management(temp_dir, temp_gdb)
arcpy.env.workspace = os.path.join(temp_dir, temp_gdb)
# Execute Create FileGDB, temp
arcpy.CreateFileGDB_management(temp_dir, temp_gdb)
#####################################
# Process: CAD to Geodatabase
arcpy.CADToGeodatabase_conversion(in_cad, temp_dir+'//'+temp_gdb, "FClass", "1000", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 11258999068426.2;-1073.7418235 4194304001953.12;-100000 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision")
#####################################
# Process: Iterate Feature Classes
datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []
for ds in datasets:
for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
path = os.path.join(arcpy.env.workspace, ds, fc)
print(path)
arcpy.FeaturesToJSON_conversion(fc, out_geojson, "FORMATTED", "NO_Z_VALUES", "NO_M_VALUES", "GEOJSON")
#####################################
# Process: Features To JSON
## arcpy.FeaturesToJSON_conversion(fc, out_geojson, "FORMATTED", "NO_Z_VALUES", "NO_M_VALUES", "GEOJSON")
#####################################
# Execute Delete FileGDB
#arcpy.Delete_management(newpath)
## return
def postExecute(self, parameters):
"""This method takes place after outputs are processed and
added to the display."""
return
... View more
02-03-2024
11:02 PM
|
0
|
2
|
852
|
POST
|
Further in research, CAD file data type is considered as a non-simple feature. Thus it cannot be used as a user input. https://enterprise.arcgis.com/en/server/10.5/publish-services/windows/parameter-data-type-transformations.htm#ESRI_SECTION1_5C6000DB9B0341008B589D07782179CA
... View more
01-14-2024
11:14 PM
|
0
|
0
|
826
|
POST
|
Hello There, We are facing below issue with ArcGIS Enterprise. The error log on ArcGIS Servers shows below information. Environment: ArcGIS Enterprise 11.1 Federated, 2 Portal machines, 2 ArcGIS Server machines There are around 5-10 messages per minute on each server(two servers, federated) Level: Warning Message: Unable to process request. Error handling service request :Could not find service. Service may be stopped or it may not be configured. Code: 9003
... View more
01-01-2024
03:20 AM
|
0
|
0
|
460
|
POST
|
@Brian_Wilson Please find below. Thanks for your interest. # -*- coding: utf-8 -*-
import arcpy
class Toolbox:
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the
.pyt file)."""
self.label = "toolbox"
self.alias = "toolbox"
# List of tool classes associated with this toolbox
self.tools = [Tool]
class Tool:
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "DWGtoGEOJSON"
self.description = ""
def getParameterInfo(self):
"""Define the tool parameters."""
params = [
arcpy.Parameter(displayName="Input CAD File",
name="in_cad",
datatype="DECadDrawingDataset",
parameterType="Required",
direction="Input"),
arcpy.Parameter(displayName="Output JSON File",
name="out_json",
datatype="DEFile",
parameterType="Required",
direction="Output")
]
return params
def isLicensed(self):
"""Set whether the 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."""
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."""
in_cad = parameters[0].valueAsText
out_json = parameters[1].valueAsText
desktop = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop')
newpath = desktop+str(r'\output')
if not os.path.exists(newpath):
os.makedirs(newpath)
arcpy.env.workspace = desktop+r"\output\fGDB.gdb"
# Set local variables
out_folder_path = desktop+str(r"\output" )
out_name = "fGDB.gdb"
# Execute Create FileGDB, temp
arcpy.CreateFileGDB_management(out_folder_path, out_name)
#####################################
# Process: CAD to Geodatabase
arcpy.CADToGeodatabase_conversion(in_cad, out_folder_path+'/'+out_name, "FClass", "1000", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 11258999068426.2;-1073.7418235 4194304001953.12;-100000 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision")
#####################################
# Process: Iterate Feature Classes
datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []
for ds in datasets:
for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
path = os.path.join(arcpy.env.workspace, ds, fc)
print(path)
#####################################
# Process: Features To JSON
arcpy.FeaturesToJSON_conversion(fc, out_json, "FORMATTED", "NO_Z_VALUES", "NO_M_VALUES", "GEOJSON")
#####################################
# Execute Delete FileGDB
arcpy.Delete_management(newpath)
return
def postExecute(self, parameters):
"""This method takes place after outputs are processed and
added to the display."""
return
... View more
12-29-2023
10:14 PM
|
0
|
0
|
985
|
POST
|
@Brian_Wilson Indentation is correct in the code, somehow it got posted wrong, all without indents. The tool worked fine in ArcGIS Pro.
... View more
12-28-2023
11:40 PM
|
0
|
0
|
1001
|
POST
|
Hello, A tool created for conversion, worked fine on ArcGIS Pro, but while/when published the Input value changed to constant value, need kindly help Environment: ArcGIS Pro 3.2.1, ArcGIS Enterprise 11.1 def getParameterInfo(self):
"""Define the tool parameters."""
params = [
arcpy.Parameter(displayName="Input CAD File",
name="in_cad",
datatype="DECadDrawingDataset",
parameterType="Required",
direction="Input"),
arcpy.Parameter(displayName="Output JSON File",
name="out_json",
datatype="DEFile",
parameterType="Required",
direction="Output")
]
return params
def execute(self, parameters, messages):
"""The source code of the tool."""
in_cad = parameters[0].valueAsText
out_json = parameters[1].valueAsText
desktop = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop')
newpath = desktop+str(r'\output')
if not os.path.exists(newpath):
os.makedirs(newpath)
arcpy.env.workspace = desktop+r"\output\fGDB.gdb"
# Set local variables
out_folder_path = desktop+str(r"\output" )
out_name = "fGDB.gdb"
# Execute Create FileGDB, temp
arcpy.CreateFileGDB_management(out_folder_path, out_name)
#####################################
# Process: CAD to Geodatabase
arcpy.CADToGeodatabase_conversion(in_cad, out_folder_path+'/'+out_name, "FClass", "1000", "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 11258999068426.2;-1073.7418235 4194304001953.12;-100000 10000;8.98315284119522E-09;0.001;0.001;IsHighPrecision")
#####################################
# Process: Iterate Feature Classes
datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []
for ds in datasets:
for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
path = os.path.join(arcpy.env.workspace, ds, fc)
print(path)
#####################################
# Process: Features To JSON
arcpy.FeaturesToJSON_conversion(fc, out_json, "FORMATTED", "NO_Z_VALUES", "NO_M_VALUES", "GEOJSON")
#####################################
# Execute Delete FileGDB
arcpy.Delete_management(newpath)
return
... View more
12-28-2023
03:51 AM
|
0
|
6
|
1245
|
POST
|
Overwrite option in ArcGIS Pro https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/geoprocessing-options.htm
... View more
12-20-2023
12:32 AM
|
0
|
0
|
275
|
POST
|
In my case, It got fixed after the port 9876 was unblocked after accidentally closed by the cyber security. 9876 (TCP)—Internal communication between the hosting ArcGIS Server site and the relational data store occurs through this port, as does some communication between the primary and standby relational data store machines. https://enterprise.arcgis.com/en/data-store/latest/install/windows/ports-used-by-arcgis-data-store.htm
... View more
12-19-2023
03:37 AM
|
0
|
0
|
424
|
POST
|
Incorrect values in domain field caused this issue, in my case.
... View more
12-06-2023
02:15 AM
|
0
|
0
|
573
|
POST
|
In my case, after upgrading ArcGIS Enterprise from 10.9 to 11.1, the related records disappeared, when I tried to view from Map Viewer. The in-memory relate was made on a column with integer data type. When I changed(the whole process of transforming field) the relate field's data type from integer to text, the related records appeared again. Hope this will help someone struck with a similar case.
... View more
12-05-2023
03:22 AM
|
1
|
0
|
1235
|
POST
|
"Validate All" in the data store and restarting the service fixed the issue for me. Environment: Oracle 12C, ArcGIS Enterprise 10.8.1 - Cheers
... View more
09-28-2023
03:11 AM
|
0
|
0
|
2250
|
POST
|
Hello @ArchitSrivastava , Thanks for your input. Hiding a service is not my current requirement. But as suggested, I have posted this in Ideas page. You may kindly share the below idea link for further reach. https://community.esri.com/t5/arcgis-enterprise-ideas/rest-services-directory-access-control-flexibility/idi-p/1323767 Have a great day!
... View more
08-29-2023
11:37 PM
|
1
|
0
|
679
|
IDEA
|
Disable access to the REST services directory for either a specific or selected users. Moreover, the portal admin shall be able to access it in all the cases.
... View more
08-29-2023
11:34 PM
|
3
|
1
|
642
|
POST
|
I am trying to disable access to the REST services directory for either a specific or selecetd users. Moreover, the portal admin shall be able to access it in all the cases. Is there anyway for this approach. Thanks in advance. Environment: ArcGIS Enterprise Federated 10.8.1
... View more
08-29-2023
02:47 AM
|
0
|
2
|
783
|
Title | Kudos | Posted |
---|---|---|
1 | 12-05-2023 03:22 AM | |
1 | 08-29-2023 11:37 PM | |
3 | 08-29-2023 11:34 PM | |
1 | 10-11-2018 01:10 AM | |
1 | 11-22-2021 11:02 PM |
Online Status |
Offline
|
Date Last Visited |
02-07-2024
09:08 AM
|