|
POST
|
I'm trying to use the Extract by Attributes (spatial analyst) GP tool (ArcMap 10.7.1) on a 1-band DEM raster, but I cannot construct a valid query in the Query Builder. No value "fields" are listed in the top of the builder to select from, and I cannot "Get Unique Values". Typing any variation of VALUE (Value, <VALUE>, 'VALUE') does not give me a valid SQL expression ("There was an error with the expression."). The raster is a projected 1 band TIFF, 32 bit floating point, uncompressed, without a colormap. Pyramids and statistics have been generated, and the image displays fine in ArcMap and in the Windows Photo Viewer.
... View more
09-22-2021
04:25 PM
|
0
|
4
|
2285
|
|
POST
|
Second part of my reply, regarding the conditional check: I read up on "if a:" on SO before, but your link did give me good additional info - thanks! In this case, either works, as both will catch the None object that is passed as the default version value. I tested, and the default value for the saveACopy method is in fact None, and not an empty string. So while "if version is not None:" is more precise, it also implies I need to create an "if else version:" condition to catch any other exemptions before my final "else:". But this did help me figure out my answer. The 'default' version parameter None was being passed when I left the optional version parameter field in my script tool blank. But I suspect that when the default is passed, the saveACopy method does not detect your installed version and remove functionality to save the MXD at that version level; instead it just uses the Save As function and updates the file name. This is indicated by the fact that new MXD grows in length by 1 KB (proportional to the longer file name?) instead of being reduced to 6 KB like the others. And I am not able to open the new MXD in 10.7 (i.e. it is still saved as a 10.8 document.) So, Dan's answer is what I will have to use in this case. I'll just need to update the tool documentation to explain this to my colleagues who will want to save at their current version.
... View more
09-09-2021
03:51 PM
|
0
|
1
|
3724
|
|
POST
|
Thanks for your suggestions, Jeff. I'm going to reply to your post in two parts. Your second assumption is (luckily) not correct; I have tested and confirmed that I can use the script to save 10.8 MXDs down to 10.6 and below, and open them in my installed version of 10.7.1. I've also seen reference to this 'hack' elsewhere on Geonet /Stack Exchange in the past. One thing I do notice that might be a concern: when using a 'blank' MXD as the input to the script, the resultant MXD gets reduced in size to only 6 KB. The version being saved to does not seem to matter. For reference, the blank 10.8 MXD I was provided is 20 KB. Creating a blank 10.7 MXD in my own environment for testing purposes results in an MXD file size of 288 KB (!). Both of these come out the other side of this script tool at 6 KB, no matter the output version.
... View more
09-09-2021
02:34 PM
|
0
|
0
|
3729
|
|
POST
|
Yes, selecting '10.6' works and allows me and my staff to open a 10.8 MXD in 10.7.1. BUT, I would like to give staff the option to save the MXD at their current version (10.7) and loose as little functionality as possible.
... View more
09-09-2021
02:21 PM
|
0
|
0
|
3732
|
|
POST
|
I've created a new script tool for saving down MXDs to previous release versions as explained here. I'm using ArcMap 10.7.1. I'd like this tool to also save down MXDs higher than my current release to my current version (i.e. save 10.8 MXDs to 10.7). I am under the impression that this is supported (https://desktop.arcgis.com/en/arcmap/10.7/map/working-with-arcmap/saving-a-map.htm). According to the saveACopy method documentation, passing the default value for the version parameter will save MXDs at your current release version. And the version parameter explanation states: (The default value is None). However, I cannot figure out how to pass the default value using my script tool. I've tried version = str(), version = None, version = "None", and version = "". All of these result in a ValueError: Invalid value for version: '' (choices are: ['10.1', '10.0', '8.3', '10.5', '10.4', '10.6', '9.0', '10.3', '9.2', '9.3']). I've also tried just leaving off the optional version parameter. The script tool will run, but when I attempt to open the new MXD, it has not been saved down and tells me that the MXD needs to be saved down using Save A Copy. Here's my current script: import arcpy, sys, os, string mxdList = string.split(arcpy.GetParameterAsText(0), ";") outloc = arcpy.GetParameterAsText(1) version = arcpy.GetParameterAsText(2) suffix = "_"+ version.replace(".", "") for item in mxdList: item = item.strip('\'') mxd = arcpy.mapping.MapDocument(item) base = os.path.basename(item) baseName = os.path.splitext(base)[0] if version: base = os.path.splitext(base)[0] + suffix + os.path.splitext(base)[1] mxd.saveACopy(outloc + os.sep + base, version) arcpy.AddMessage(os.path.basename(item) + " has been converted") else: mxd.saveACopy(outloc + os.sep + baseName + "_107.mxd") arcpy.AddMessage(os.path.basename(item) + " has been converted")
... View more
09-07-2021
05:43 PM
|
0
|
6
|
3991
|
|
POST
|
Hi! I'm testing a script to identify which version of ArcMap an MXD was saved at, as explained here. I am currently at version 10.7.1 and want to test identifying and saving down and MXD created in 10.8. Does anyone know where I can find a basic MXD created in 10.8 for download (blank would be preferred)? FYI: I've tried the MyESRI.com downloads page, but they are large downloads that require an administrator account to run the executable.
... View more
08-27-2021
02:13 PM
|
0
|
2
|
5208
|
|
POST
|
Thanks for the quick fix, Joshua! That's the same indenting I ended up with, I was just doubting myself when I wasn't getting the results I expected. I was running this on an MXD I thought I saved down to 10.3, using the saveACopy function from ArcPy. I was hoping to use William's code to verify it worked, but the result list is empty for any of the MXDs I save down with my custom Python Tool. However, I just tested William's code on an MXD I saved a copy of at 10.3 using the ArcMap 10.7.1 GUI, and his code did work, returning "10.3". So it looks like my saveACopy Python tool, based on the code here, is either not working properly, or the binary structure of the saved MXD's fileContents no longer matches the format this code is intended to interpret. FYI: I've also added: mxd107 = '10.7' + u'\u0018' to the declared variables and added mxd107 to the mxdList, and can confirm that this will work on MXDs saved at 10.7. Can we assume that mxd108 = '10.8' + u'\u0019' ?
... View more
08-27-2021
10:05 AM
|
0
|
0
|
1544
|
|
POST
|
I know that the ArcPy function saveACopy will allow you to save MXDs from your currently installed ArcMap version down to a previous version. Since running this function does not require you to open the MXD(s) in ArcMap, I'm wondering if using this function is a solution for saving down an MXD from a version higher than you have installed to your current version of ArcMap. For reference, my organization currently is using 10.7.1. I'd like to be able to save down 10.8.1 MXDs that are delivered to us from clients. PS: I'm creating a Python tool in our company's custom toolbox so that I can enable all our users to use this function on multiple MXDs at a time. Looking at the version parameters available in 10.7.1, I think I'll have to use the default value to save at 10.7, instead of actually choosing "10.7" from the list.
... View more
08-27-2021
09:29 AM
|
0
|
0
|
802
|
|
POST
|
Hi William - thanks for keeping the thread alive! I'm trying to get your code to work in the Python window in Arc, but (I think) the indenting is screwing me up. I keep getting "IndexError: list index is out of range" for the last line, which I take to mean that the result list is empty. Is there a way to share the python code with the indent formatting in tact, like used to be possible on GeoNet? FYI: I'm using ArcMap 10.7.1 and trying the code on an MXD (I believe) I saved down to 10.3.
... View more
08-26-2021
04:38 PM
|
0
|
2
|
1561
|
|
POST
|
I ended up inspecting the XML further with XRay to look for anything out of the ordinary. When I validated the XML it indicated there were issues with the domains that had been created/updated in ArcGIS Online. I deleted domains that only had a single coded value, and renamed them to remove the Global ID that ArcGIS Online adds to the name. After these changes, I was able to use XRay to import the XML schema to a new file geodatabase successfully. FYI: This does disable your attachment relationship classes, but preserves the other relationship classes. But it is fairly easy to just reenable your feature classes and tables for attachments after they are created. Takeaway - clean up any domains that were created in ArcGIS Online when you export to a FGDB.
... View more
08-08-2021
06:32 PM
|
1
|
1
|
6262
|
|
POST
|
For others that find this question: I was able to add the second geodatabase's edited XML to the new geodatabase I had added the first XML to by using "Import Using Geoprocessing" under XRay's main menu. This preserved all the relationship classes EXCEPT the _ATTACH related table, which is easy enough to recreate with "Enable Attachments".
... View more
08-06-2021
12:52 PM
|
0
|
0
|
1743
|
|
POST
|
Is anybody still using the XRay add-in at 10.7.1? I don't see the "Merge" function listed in the tool drop downs anymore. I'm trying to take 2 existing feature class schemas from existing geodatabases, make some edits to their schemas, and merge them (as 2 feature classes with related tables) into a new geodatabase. I can analyze their differences, but without the merge tool I'm not sure how to import both schemas without the second overwriting the first. FYI: I tried exporting to a scratch FGDB, then using Feature Class to Feature Class, but this does not bring along the related tables and relationship classes.
... View more
08-06-2021
11:19 AM
|
0
|
1
|
1762
|
|
POST
|
I was able to get around the Export Data wizard error by using "Feature Class to Feature Class" GP tool. Still no option to select the GDB version, but I shouldn't be able to save in a higher version from 10.7.1. Comparing the GDB feature class exported with Arc to the one exported with AGOL, the AGOL version correctly preserved the _ATTACH table and relationship class, plus the Inspection table and relationship class. The ArcMap export only persevered the _ATTACH table and relationship. Thus, the ArcMap export does not help me. Are there restrictions on the number of relationship classes that I am running up against?
... View more
08-05-2021
04:00 PM
|
0
|
0
|
6320
|
|
POST
|
Hi Brian. I can't find a way to chose the version of FGDB that AGOL uses when you export a hosted feature class. The metadata on the item page also doesn't give me any info on the version of the GDB. Viewing the GDB properties in ArcMap just says that the GDB matches my current version of Arc (10.7.1) and can't be upgraded. I attempted to export the feature class using ArcMap instead of AGOL (as shown here), hoping that would force the FGDB to my current version. However, this continually fails with any name in any location. This may be related (or not).
... View more
08-05-2021
03:11 PM
|
0
|
1
|
6321
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-12-2026 02:09 PM | |
| 1 | 03-21-2025 03:07 PM | |
| 1 | 12-04-2025 04:57 PM | |
| 1 | 10-23-2025 04:54 PM | |
| 9 | 10-01-2025 12:20 PM |