|
POST
|
Thanks Derek. I have upgraded Server and Web Adapter to 10.2 now, and that all seems to be working. Yea! Now I'm just waiting for the Portal authorization number and I'll be ready to give it a try. 🙂
... View more
08-09-2013
07:23 AM
|
0
|
0
|
1524
|
|
POST
|
The https://github.com/Esri/ago-tools toolset has some interesting tools for accesing AGOL items, including updating service URLs in web maps. My guess is if the URLs can be updated, that an inventory might be able to be made also. I have just started looking at this toolset myself so I can't add too much more about it. But it looks to have a lot of potential, and since it is on github, hopefully more features will be added to it. There is a download a zip on the right side if you just want to take a look at it (python)....if you are like me and not confident enough to jump into the cloning and forking yet. The author says he is open to suggestions for new features. This is not an immediate solution to your issue, but is worth checking out anyway.
... View more
08-08-2013
01:22 PM
|
0
|
0
|
500
|
|
POST
|
@gsimpson4 This may not be the case for you, but I noticed on the upgrade, my assigned roles for administrators and publishers did not move forward with the upgrade. I was/am using Active Directory and the GIS Tier. To correct, I opened manager, went to the Security tab, and made sure my Active Directory (AD) connection still was valid. Then I went into roles and reapplied all the "administrator" and "publisher" settings to the AD groups. By default they all reset to "user". Personally, although it's a slight inconvenience, I don't think this is a bad thing with the upgrade. At least it makes you revisit the security a bit. BTW - I did have a smooth upgrade on my dev and prod server. I actually remove Desktop 10.1 before up upgrading server. I don't know that it was necessary, but I figured it would make things simpler. I then stopped the ArcGIS Server service. The install took a while, partially because we have a lot of services that neede to be restarted. (once complete, I installed Desktop 10.2) For the Web Adaptor (on a separate IIS machine), I have two web adaptors installed...one with port :80, the other with port :443 (with ssl cert). The install recognized both ports. Only issue I had with this portion is when the "config" windows tried to come up for each of the web adaptors, it attempted to use "localhost" which on my IIS machine did not work. When I changed "localhost" to the DNS name, I was able to configure it for both :80 and :443.
... View more
08-08-2013
08:37 AM
|
0
|
0
|
1528
|
|
POST
|
Derek, Did i read the install help correctly and you can use one web adaptor for both ArcGIS Server and Portal? I currently have Server 10.1 set up with two web adaptors, one for :80 and one for :443. I plan to use the :443 version for my portal also. Will this work? Just reading and starting the web adaptor install now (the 10.1 upgrade, not new install).
... View more
08-07-2013
03:54 PM
|
0
|
0
|
1524
|
|
POST
|
@gsimpson4 - I'm about to try the update-on-top-off-10.1 process, but I'm a little nervous. Any idea why you had the issue? Did you shut down the 10.1 service prior to the update? Did you update Desktop first if it's on the machine? I noticed on testing a "clean" install on another test machine, when I try to have the \arcgisserver\directories on my 😧 drive instead of the deafult C:, it does not create the folder and therefore gives me an error when I start up (or that's what I now think the issue is). Not sure if this is a bug or if I still have residual links from previous installs that are causing issues, but I had the directories on the 😧 drive for 10.1 and prior versions with no problems (and 10.2 eap). I had renamed the old folders before installing the new, so it should have recreated. Did you have any of these issues?
... View more
08-06-2013
04:13 PM
|
0
|
0
|
1528
|
|
POST
|
Advantage Python: arcPy is nicely optimized for doing some bulk map operations, so depending on what you want to do, it may be tons easier in arcPy. This is especially true if you don't require any user interaction to run the tool. For speed of development, Python may be what you prefer. Although, I did find setting up a Python Add-in to be a bit trickier at first, once you have done it once, you won't have any problems. If you have custom toolbox with python scripts that are already setup to take advantage of the built-in user interface for getting attributes, it is easy to turn this into a addin, very few steps. This may not be the user interaction that @Vicki is refering to, but if all you need is the basic tool interface, this works slick. Assuming you have a custom Toolbox and python scripts with the parameters/GUI already setup (i.e. a standard ArcGIS Toolbox) Download, unzip, run Addin wizard. Make sure to create a toolbar with at leat one button. Copy <your toolbox>.tbx into the addin's \install folder Create a subfolder under \install called "scripts" (or whatever you want to call it) Copy all the scripts associated with your toolbox into the \scripts folder In Catalog, open \install\<your toolbox>.tbx, make sure relative path box is checked, and point source to new location in \Install\scripts Modify \install\<addin>_addin.py, add the following afer the other import statements: import os
relPath = os.path.dirname(__file__)
toolPath = relPath + r"\<yourToolBoxName>.tbx" For each button under def onClick(selfk): replace each pass with YourToolName : (where <YourToolName> is the name listed in your Toolbox properties) pythonaddins.GPToolDialog(toolPath, <YourToolName>) Compile, deploy, test If this doesn't make sense and you would like more info, let me know. You can check out the help for GPToolDialog, but I find the help is still missing a few critical steps to make this easy. I have another forum entry and some powerpoint slides if anyone is interested. Edited 4/8/2015 to fix bad formatting from old forum to GeoNet conversion. Also added a PDF of a presentation I did at our local dev meetup a couple years ago on the subject....older, but should still be valid.
... View more
08-06-2013
03:11 PM
|
0
|
0
|
1986
|
|
POST
|
This is an older post, but using it for a place to store my Python addin gotchas and fixes. The date in title is last update. NOTE: Python Addins will not work with Pro, however the Tools in your Toolbox may, although may need some tweaking 9/7/2017 - note... the {..} folders are stored in C:\Users\<user>\AppData\Local\ESRI\<Desktop10.x>\AssemblyCache\ this is typically a hidden path and may require admin rights to access. Making note of this as I move to 10.5.x and may need to manually move the folders is the .addin doesn't work. Sometimes will not even on different versions. Sharing and installing add-ins—Help | ArcGIS Desktop Error message: The "TypeError: GPToolDialog() takes at most 1 argument (2 given)" is a very misleading message and is a bug (NIM089253) My solution: This process helped me get rid of this message and was a simple was to add my custom python tool/toolbox to an addin button. [Update/comment...actually I think the error message still shows in the Python window, but it seems to be harmless] This post assumes you have already run the wizard so some buttons are stubbed out and you are modifying the addin_addin.py (or YourProjectName_addin.py if you renamed it). I'm assuming it will work with other classes, but I only tested it with toolbar-buttons. This also let me take advantage of the python tools that I already had working in my toolbox. One of the advantages of this is that any dialog box you already have associated with your tool on start-up (i.e. in the tools parameter tab) will still be in place. Some of this info is scattered around the forums (but the online help is lacking right now), so I thought it may help to consolidate what worked for me, in case it helps others. This is how I was able to get the GPToolDialog to work with my custom python tools/toolbox: Copy your .tbx file into the addin wizards "Install" folder. Create a "scripts" folder in the same location Copy all your .py script to this folder Open the .tbx in the Install folder, make sure "relative path" is checked, and re-point all the tools to the new script location the "import os" and the "relPath = " line seem to be the key....see sample code below import arcpy
import pythonaddins
import os
relPath = os.path.dirname(__file__)
toolPath = relPath + r"\CheckAndFixLinks.tbx"
class ButtonClass1(object):
"""Implementation for YourProjectName_addin.button (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
""" tool path could also be set here instead, if you would like """
pythonaddins.GPToolDialog(toolPath, "ToolNameFromToolbox")
Updated 10/18/2015: modified lines 5 and 13 to remove some confusing info. TIP: If you have any custom or special python modules you want to package with the addin, that is modules that are usually stored in C:\Python27\ArcGIS10.1\Lib (which you may import in your tools) but aren't part of the normal ArcGIS or Python install, if you place these in the scripts folder, that seems to work the best. TIP/Warning: Remember, if you open the project up in the wizard again....which is sometimes necessary...and it tells you it is saving a backup _addin.py file, this backup contains the customization you did and the new file may be back to the defaults from the wizard. You may need to open both files and copy any custom code back into the new file. This method seems to be the cleanest process I've found to do this, at least at version 10.1 (and the addin released April 2012). Anyone else have tips? Tip - missing button images (added 8/1/2017) - I've had addin's that were working fine and had the button images, then updated the button layout or other item in the config, and then received an error that the images were missing (when I know they are not). This is a bit misleading, but chances are I messed up when I modified one (or more) of the following: the Toolbox, the config.xml or the <name>_addin.py file. What I check to get it to work: In the toolbox: Check to make sure the path to the .py associated with a Tool, is correct (in the Tool's property) Config.xml for any syntax errors of missing < or > etc. Make sure the that every <Commands><Button ... id="name.button"> has a matching <Toolbars><Toolbar..><Items><Button refID="name.button"> They must match, and it is helpful to read if int he same order. Check for typos <addin name>_addin.py check for any syntax error make sure that every <Commands><Button ... class="classname"> in the config.xml file has a matching "class <classname>(object): in the file check for typos Tip - "Different versions" (added 6/14/2016) - ran into this issue today Add-In Wizard unable to find matching ArcGIS installation on this machine because I have different ArcGIS versions on different machines. Leaving the version at 10.2.2 allowed me to install on both 10.2.2 and 10.3 machines. My additional comments on this thread.... https://community.esri.com/message/615036#comment-615036 Tip: (added 6/16/2016) Having issues with getting the .addin to actually install or update in ArcCatalog/Map?? OR, updating often and don't want to have to close/reopen after updating? In the ArcCatalog/Map (whichever the addin was created for), Customize->Toolbars->Customize->Add-From-File navigating to the location of the <addin>.esriaddin file and select that file. After the normal confirmation page to "Install Add-In", another window popped up that showed it adding the tools in my addin toolbox To verify it worked, you can check to see if the update date has changed for the addin, you can go to the C:\Users\<username>\AppData\Local\ESRI\<Desktop version>\AssemblyCache folder. You may need to 1) give windows explorer permission for you to view this folder, and 2) go into the {hashtag} folders to see which is the correct addin folder. Not having to close and reopen my Catalog/Map session to get this to update is really a time saver! -->Note (added August 3, 2016) - this method will only work if updating the .py file. If the actual toolbox or tool are updated, still need to close/double-click-addin-file/open to have it appear. Latest help docs: What is a Python add-in?—Help | ArcGIS for Desktop 10.3.x What is a Python add-in?—Help | ArcGIS for Desktop 10.4.x tagging my own blog so I can find this again hopefully: Rebecca's GIS in Alaska Python AddIns python snippets
... View more
05-15-2013
08:03 AM
|
2
|
4
|
12395
|
|
POST
|
I have a couple custom .py modules that live in my C:\Python27\ArcGIS10.1\Lib directory. I "import" these into all my tools (mainly custom utils that I use alot). I've created a python addin.esriaddin, using the wizard and customized it to use the tools from my custom toolbox. For the addin creation, I've copied the .py file from these modules into the \addin\Install folder, so they do get included with my addin package, but on install to a new machine, they do not get deployed to the \Lib directory. Is there a way to do this that I am missing? Or should I call the in my script tools using relative paths to the \addin\Install folder. I'm just not sure how this would be referenced when installed on a different computer. Has anyone done this or have any suggestions? Thanks --------- UGH...never mind. I just moved them to the folder with my other scripts (i.e. addin\Install\scripts in my case). Since my tool scripts do not specify a folder, it appears it first looks in the current folder of the calling script, before or if it doesn't find it in the \lib folder. In any case it worked for this addin. I should have checked that before posting...but if this helps someone else....
... View more
05-08-2013
02:46 PM
|
0
|
0
|
1376
|
|
POST
|
I don't believe that level of access is exposed to the arcpy module, that is getting into ArcObjects territory. Thanks. I figured that was the answer, but didn't want to assume.
... View more
02-07-2013
01:20 PM
|
0
|
0
|
685
|
|
POST
|
Is there an arcpy command that can will OPEN and display an attribute table of a given feature class (programatically)? I'm using arcpy.mapping.UpdateLayer to change the symbology and field visibility, but then I want the attribute table open (without manually having to do so). The script is attached to a button that is prepping the feature class for editing. Another button will select a subset of features, zoom, and then allow the user to update attributes. I know that the attribute can be opened with a right-click one time and the edit button will work, but it would be nice if this could be built in to the editing button in case the attrbitue table wasn't already open. I'm open for other suggestions (but sticking with arcpy). Thanks
... View more
02-07-2013
01:05 PM
|
0
|
2
|
1597
|
|
POST
|
How do you update the statistics? I know this is a pretty old thread, but in case others have the same question. Personally, I have had inconsistent issues with the Importing of 10.0 caches into 10.1, but much better luck with copying. What has worked for me... 1. create service without a cache 2. stop service (this may not need to be done....but doesn't hurt) 3. copy 10.0 cache to the 10.1 arcgisserver\directories\arcgiscache 4. verify the folder name is the same as the new service "foldername_servicename" (that is if the service is not in root folder) 5. start up service 6. right click on service, select Service Properties, verify cache properties....make sure that that "update cache maually" is selected (bottom of screen).....and that "Using times from a cache" is select. (this may still show "Dynamically from the data"). When you apply this, it should create the Status.gdb -- but may still show 0% for all scale levels. 7. Then, update the status using the "ManageMapServerCacheStatus" tool in the Server Tools Toolbox->Caching. From what I can tell, this looks thru all the available tiles and actually updates the status. Be aware, that the "expected tiles" may not equal the "completed tiles", and Percentage may not be 100% if you did not cache the full extent of the service at some scales. I have used the Manage Map Server Cache Status on (a copy of) the same service that I used the import command on. It will force the refresh and correct problems on some scales, but on others, some tiles did not fully import. I repeated this several times -- even exported to "exploded" and repeated, but getting the same bad results (missing data), so it may be my 10.0 tiles...although they work fine in 10.0. Unfortunately, I can not recreate them. But since the copy works, and is much faster, that is now my preferred method. For additional info on importing the cache, check out Andrew Stauffer's response (#6 http://forums.arcgis.com/threads/62320-Caching-in-10.1-produce-inconsistent-results?highlight=10.1+cache+import Lots of good info there.
... View more
12-03-2012
01:41 PM
|
0
|
0
|
983
|
|
POST
|
Some suggestions below. GetParameterAsText() will return "" (not "#") if the parameter was not set and you haven't set a default value in the script tool parameters tab. "" evaluates to false in an if, so I often do this:
theCoverage = arcpy.GetParameterAsText(0)
if not theCoverage:
theCoverage = r"c:\_data\_Skwentna07\covers\trans07\arc"
If you think you may run this from Windows instead of from a toolbox, you can support "#" like this:
theCoverage = arcpy.GetParameterAsText(0)
if theCoverage in ["","#"]:
theCoverage = r"c:\_data\_Skwentna07\covers\trans07\arc"
This change makes sense. I think the other code was from the python class I took a few years ago and I never revisted it in the newer versions/toolbar.
... View more
10-31-2012
01:46 PM
|
0
|
0
|
947
|
|
POST
|
I was also having issues, more with trying to figure out what "datatype" it wanted when attaching the script to a toolbar. I finally got "Dataset" to work (not coverage like I would have guessed). I am using 10.1 btw. Simplified code with parameter setup is below. I used "Workspace or Feature Dataset" and "Any Value" for the data type of the other two variables. Update (caution): if the coverage is not DOUBLE precision and then CLEANed (with ARC option), the command may not import all records. But with the CLEAN, some lines may get flipped, which for my project is a problem. Just using the BUILD with ARC option didn't improve anything. Best option for me which doesn't flip line direction is to use the ARCSHAPE command (one the SINGLE or DOUBLE precision coverage....no difference) and then use FeatureClassToFeatureClass to import the shape file.
... View more
10-31-2012
07:33 AM
|
0
|
0
|
947
|
|
POST
|
Hi @scoggins, I was also having issues, more with trying to figure out what "datatype" it wanted when attaching the script to a toolbar. I finally got "Dataset" to work (not coverage like I would have guessed). I am using 10.1 btw. Simplified code with parameter setup is below. I used "Workspace or Feature Dataset" and "Any Value" for the data type of the other two variables. import arcpy
#setup variables
arcpy.env.overwriteOutput = True
theCoverage = arcpy.GetParameterAsText(0)
if theCoverage == '#':
theCoverage = r"c:\_data\_Skwentna07\covers\trans07\arc"
#theCoverage = r"c:\_data\_Skwentna07\covers\trans07\arc"
theWorkspace = arcpy.GetParameterAsText(1)
if arcpy.env.workspace == '#':
arcpy.env.workspace = r"c:\_data\_Skwentna07\Reports\RetroFitDev2\newTest.gdb"
#C:\_data\_Skwentna07\Reports\RetroFitDev2\newTest.gdb
#arcpy.env.workspace = r"c:\_data\_Skwentna07\Reports\RetroFitDev2\newTest.gdb"
theWorkspace = arcpy.env.workspace
outFC = arcpy.GetParameterAsText(2)
if outFC == '#':
outFC = "cleanTrans" # Transects
print(" Converting the coverage to a FC " + str(outFC))
arcpy.FeatureClassToFeatureClass_conversion(theCoverage, theWorkspace, outFC)
....or at least it worked a couple times....now?? UGH! ((it did work, kind of....wrote to my mxd env which was still set to the default gdb instead of theWorkspace variable. The default fgdb in 10.1 messes with me all the time!)
... View more
10-30-2012
07:03 AM
|
0
|
0
|
947
|
|
POST
|
Hi Joe - Is there any chance the ArcGIS for Local Government - Address Management add-in has the tools you need? Maybe the Create Road and Split Intersecting Road tool? http://resources.arcgis.com/en/help/localgovernment/10.1/index.html#//028s00000073000000 I can't seem to find the download for the Address Managment add-in. Keeps sending me in circles, do you have a direct link? I wanted to see if that would help in my situation. My task: I have transects that are already split into segments of variable lengths. I need to re-divide the non-contiguous transects into 1Km segments. Some of the segments are already shorter than the 1Km, so will have to have additional length added from the next segement (and deal with the remainder). Each new segement will retain it's old tag, and get a new field with a unique identifier for the new segment. Then I will need to reassign the appropriate new segments tags to an associated point feature. I have just started my search for possible tools or starting points, but realize I will probably have to write something more custom. If anyone has any suggestions or leads, it would be appreciated. I most likely will need to start a new thread for this, but just in case.... Thanks
... View more
09-13-2012
10:21 AM
|
0
|
0
|
1070
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-08-2018 08:21 AM | |
| 1 | 10-07-2015 09:48 AM | |
| 1 | 10-25-2015 12:23 PM | |
| 1 | 11-02-2017 09:00 AM | |
| 1 | 11-04-2016 02:11 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-31-2025
04:56 PM
|