|
POST
|
I've been dealing with this issue for a couple of months. I have a Python script that converts CAD files to Geodatabase feature classes for nearly 100 facilities. The script runs flawlessly every time in IDLE 2.7.13. When I run the script in a toolbox in ArcGIS Pro 2.2.4, at least half the time the script fails at some point. It's usually on the tools arcpy.AddField_management (error 000852) or arcpy.Merge_management (error000735) . When the script does run to completion in Pro, the resulting feature classes are different from those generated by the standalone script. There are many null features, and/or data is copied from one DWG record to dozens of other features. I believe these errors are caused by record IDs not being correctly copied from a room report CSV using the arcpy.TableToTable_conversion tool. I've made sure the script is Python 3 compatible and run the Analyze Tools for Pro tool with no errors. The only differences between the two versions of the script are arcpy.AddMessage functions in place of "print" and hardcoded paths in the standalone version versus arcpy.GetParameterAsText parameters in the ArcGIS Pro toolbox. Is anyone else having these kinds of problems with ArcGIS Pro? I'm OK with using the standalone script, but I want others to be able to use the tool in Pro. One hypothesis I have is that the script could be failing because ArcGIS Pro is open during the process, possibly due to memory errors. A few times when I have run the standalone script with Pro open and tried to refresh the geodatabase, the standalone script will error out.
... View more
12-28-2018
09:46 AM
|
0
|
5
|
2874
|
|
POST
|
Ugh, I just discovered that one of my dwg directories was corrupted. It's working now. Yes, the script is attached to a toolbox in ArcGIS Pro.
... View more
11-13-2018
02:47 PM
|
0
|
0
|
269
|
|
POST
|
Sorry, it doesn't error out, it just completely skips this definition and errors out on a later merge, because there are no inputs from findDWGs() to merge. I only included a small chunk of the script, exclude is a list defined elsewhere. I put in a print statement from an os.listdir() to prove that the path is correct. Again, this works in IDLE, but not Pro. Do I need a different syntax for the filepath for Pro to recognize it? I've also tried DWGDir = r'W:\CADtoGIS_Testing\Site_Group_' + str(site_group). Here is more of the script. The functions in main() are all defined above. def main():
arcpy.AddMessage("Starting at " + str(datetime.datetime.now()))
findDWGs(DWGDir)
CADtoGeoExport()
filterFeats()
addFloor(polygon)
addFloor(annotation)
arcpy.AddMessage("Floors added")
update_fields_regex(polygon)
update_fields_regex(annotation)
arcpy.AddMessage("Fields updated regex")
joinFeaturesByFloor()
prepFeatures()
joinRoomData()
repGeom(roomPolygonsWithIDs)
cleanUp()
arcpy.AddMessage("It's a clean machine")
if __name__ == "__main__":
for site_group in range(1,6):
DWGDir = r'W:\CADtoGIS_Testing\Site_Group_' + str(site_group)
roomPolygonsWithIDs = Dir + "\\Rooms_w_SpaceID_Group_" + str(site_group)
triSpaceLines = "mergeCADtoGeoLinesTriSpaceLabel_Group_" + str(site_group)
polyline = Dir + "\\" + triSpaceLines
dwgpolys = []
CADtoGeoPolygons = []
CADtoGeoAnnotations = []
CADtoGeoPolylines = []
fdList = []
mergeCADtoGeoPolys = "mergeCADtoGeoPolys"
mergeCADtoGeoAnnos = "mergeCADtoGeoAnnos"
mergeCADtoGeoLines = "mergeCADtoGeoLines"
annochunk = "annochunk"
triSpacePolys = "mergeCADtoGeoPolysTriSpaceLabel"
triSpaceAnnos = "mergeCADtoGeoAnnosTriSpaceLabel"
annoXYLyr = "annoXY"
exclude = ['EDITS', 'EXCEPTIONS']
annolatlong = ['Lat', 'Long', "SHAPE@Y", "SHAPE@X"]
CADtoGeoWhere = '"' + "Layer" + '"' + " in ('triSpaceLayer', 'triLabelLayer')"
annoWhere = " AND (NOT " + '"' + "Lat" + '"' + " is NULL)"
polygon = Dir + "\\" + triSpacePolys
annotation = Dir + "\\" + triSpaceAnnos
polygonLay = "Polygons_layer"
annotationLay = "Annotations_layer"
fields = ["DocName", "Floor"]
floors=[]
outputFeatLi = []
deleteLists = [fdList, outputFeatLi, CADtoGeoAnnotations,dwgpolys,
CADtoGeoPolygons, CADtoGeoAnnotations, CADtoGeoPolylines,
fdList, outputFeatLi]
deleteFeats = [mergeCADtoGeoPolys, mergeCADtoGeoLines, mergeCADtoGeoAnnos,
mergeCADtoGeoAnnos+"_1", triSpacePolys, triSpaceAnnos]
main()
... View more
11-13-2018
12:37 PM
|
0
|
2
|
2092
|
|
POST
|
Well, it's really only working when run in IDLE. Currently the only input parameters for the tool are output geodatabase and a csv table. Now that I have the input dwg CAD files split into five different directories, the script completes the process for each group, deletes all the interim files from the geodatabase and moves to the next group. The random error issue is gone, and the script runs to completion in IDLE. The problem I'm having now is that the dwg input directories are defined in the loop using a range(1,6). I have the directory set as an empty string global variable. When I try to run the tool in Pro, it can't find the first directory and errors out. This doesn't happen in IDLE. DWGDir = ""
def findDWGs(DWGDir):
for dirName, subdirList, fileList in os.walk(DWGDir):
subdirList[:] = [d for d in subdirList if d not in exclude]
for fname in fileList:
if fname.upper().endswith('.DWG') and "_POLY" in fname.upper():
dwgpolys.append(os.path.join(dirName, fname))
for site_group in range(1,6):
DWGDir = "W://CADtoGIS_Testing//Site_Group_" + str(site_group)
arcpy.env.workspace = Dir
findDWGs(DWGDir)
... View more
11-13-2018
11:42 AM
|
0
|
4
|
2092
|
|
POST
|
Also, the arcpy.CreateFileGDB_management() tool isn't working correctly, even with the third argument set to "CURRENT". It looks like a normal folder in Pro, instead of the grey oil tank icon, and it causes the script to fail with this error: 000837: The workspace is not the correct workspace type.
... View more
11-09-2018
09:04 AM
|
0
|
6
|
2092
|
|
POST
|
It's using anywhere from 1.5 to 2GB of memory running in IDLE, another 1GB if run in ArcGIS Pro
... View more
11-08-2018
02:12 PM
|
0
|
0
|
2092
|
|
POST
|
I have a Python script that converts CAD files to geodatabase feature classes and annotation files, and then merges them all into two line and polygon feature classes at the end. It gathers hundreds of .dwg files from nearly 100 different buildings during the process. I started using the script in an ArcGIS Pro toolbox, and moved to a standalone Python script for testing. I have never been able to get the script to run in it's entirety in ArcGIS Pro or in IDLE. It throws up random errors 1.5 or 2 hours into the process. When I rerun the script without making any changes, I'll get a different random error. The last one was from arcpy.CopyFeatures_management: XML document must have a top level element. ERROR 000021: Failed to create the output annotation feature class. When I split up the buildings into batches of 20 or so and run the script 5 times into 5 different geodatabases, everything works like a charm. I'm wondering if the geodatabase schema is getting locked, or something is getting caught up in memory. I can't really pin down what's happening. Anybody experienced something similar with arcpy and geodatabases?
... View more
11-08-2018
01:05 PM
|
0
|
10
|
2525
|
|
POST
|
I will try this. I'm currently deleting two integer fields at once. I'm also having trouble with geodatabase schema locks when my script runs for more than two hours. It converts CAD data to feature classes and annotation and summarizes everything for nearly 100 buildings, so it takes a long time. I know what you mean. This tool runs fine in standalone or in a toolbox in ArcMap 10.5, but fails in Pro. I've run the tool to make sure it's compatible with Pro, and it returned no issues. I thought the process might be quicker in Pro, but it seems really buggy.
... View more
11-07-2018
09:07 AM
|
0
|
0
|
1663
|
|
POST
|
I am having the same trouble while running a script tool in ArcGIS Pro 2.2.3. The fields will be deleted from several features, and then the tool will eventually fail. This does not happen running the script in IDLE.
... View more
11-06-2018
01:20 PM
|
0
|
0
|
13958
|
|
POST
|
OK. I added a table to table conversion from the csv with field mapping to reformat the RecordID to text and Useable Area field (text number to float) and it worked running the tool in ArcGIS Pro.
... View more
11-01-2018
01:16 PM
|
0
|
0
|
1870
|
|
POST
|
I think the issue might also be arcpy.CopyRows_management, because in standalone Python, four rows are copied from the csv to the featureClass with no issues. Run in the toolbox in Pro, all of these fields are there but the values are null. Only two of the four fields are actually calculated in the code snippet above. I looked at the formatting, and the "Text" field from the featureClass is indeed a text field. The RecordID field in the csv is general format. I tried saving it as a text field, but the issue persists. It doesn't work in Pro with the field named either "Text" or "TextString" but it works in IDLE. featureClass: CSV:
... View more
11-01-2018
10:49 AM
|
0
|
2
|
1870
|
|
POST
|
I have a Python script that joins a csv table to a geodatabase feature class. This works fine when I run the script in IDLE(2.7.13), but when I run this script from a toolbox in ArcGIS Pro, the field values are all null after the join. I made sure that the script is compatible with Python 3, and ran the Analyze Tools for Pro tool and found no issues. Here is a code snippet: arcpy.CopyRows_management(csvReport, "roomReport")
arcpy.JoinField_management(featureClass, "TextString", "roomReport", "RecordID", joinFields)
arcpy.Delete_management("roomReport")
arcpy.CalculateField_management(featureClass, "SiteFloor", "!Site! + ' ' + !Floor!", "PYTHON")
arcpy.CalculateField_management(featureClass, "UsableSF", "int(round(float(!UsableArea!)))", "PYTHON")
One thing that is very confusing is that the join field from the featureClass is called "Text" in the attribute table. This matches to the "RecordID" in the csv table. When I run the script standalone, "TextString" works (this script was written by someone else so I'm not sure about this discrepancy). When I run the script in the Pro toolbox, I get an error "field 'TextString' does not exist in the table" which is what I would expect to happen. I've tried adding a field called "TextString" to the featureClass, and calculating it's value as "Text" but this hasn't worked. If I change the match field to "Text" in the script, it also doesn't work.
... View more
11-01-2018
09:28 AM
|
0
|
4
|
2229
|
|
POST
|
I'm still trying to figure this out. Does anybody have experience with this?
... View more
09-25-2018
10:45 AM
|
0
|
0
|
1057
|
|
POST
|
Yes, the default web adapter that's created during the ArcGIS Web Adapter install is called "arcgis." You can name it whatever you want to.
... View more
07-09-2018
01:04 PM
|
1
|
0
|
10561
|
|
POST
|
I have a Cordova/PhoneGap/ArcGIS JS hybrid app with CSS webkit animation that is a flashing dot on the user's location on a map. It is based on this example for geolocation. The dot flashes as it should on my older iPhone 5c and Android, but not on my newer iPad or an iPhone X with iOS 11.3. It's just a solid red dot. Do I need special CSS settings for iOS 11? Here is the CSS and my HTML meta tag: @-webkit-keyframes
pulse
{
0%
{
opacity: 1.0;
}
45%
{
opacity: .20;
}
100%
{
opacity: 1.0;
}
}
@-moz-keyframes
pulse
{
0%
{
opacity: 1.0;
}
45%
{
opacity: .20;
}
100%
{
opacity: 1.0;
}
}
#map_graphics_layer {
-webkit-animation-duration: 3s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: pulse;
-moz-animation-duration: 3s;
-moz-animation-iteration-count: infinite;
-moz-animation-name: pulse;
}
#map_graphics_layer {
-webkit-animation-duration: 3s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-name: pulse;
-moz-animation-duration: 3s;
-moz-animation-iteration-count: infinite;
-moz-animation-name: pulse;
} <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui,viewport-fit=cover">
... View more
06-14-2018
08:30 AM
|
0
|
1
|
2264
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-08-2019 09:21 AM | |
| 1 | 04-05-2019 04:21 PM | |
| 2 | 04-01-2019 10:11 AM | |
| 1 | 03-22-2019 09:30 AM | |
| 1 | 05-16-2019 08:42 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|