POST
|
We already answered this offline as well but to not leave the geonet community in the dark, we did the following: 1) Add a button to the addin. 2) Add the PYT to the install folder in the addin. 3) Use the pythonaddins.GPToolDialog command to add the tool wired to the relative path of the file using syntax to that found below:
x = os.path.dirname(sys.argv[0])
z = os.path.join(x, "KenFold.pyt")
I hope this helps anyone else running into this issue.
... View more
09-09-2014
03:07 PM
|
0
|
0
|
1712
|
POST
|
Hi Ken, If you were interested in doing this as a Python Toolbox, here is another way to do the same functionality as listed above. Thanks!
import arcpy
import os
import sys
global layerList
global dataLocation
class Toolbox(object):
def __init__(self):
self.label = "Folder Toolbox"
self.alias = "folders"
# List of tool classes associated with this toolbox
self.tools = [findFolders]
class findFolders(object):
def __init__(self):
self.label = "Finds Layer Files"
self.description = "This tool will find layer files in a folder and will update that folder with those files."
def getParameterInfo(self):
#Define parameter definitions
# Input Features parameter
in_workspace = arcpy.Parameter(
displayName="Input Workspace",
name="in_workspace",
datatype="DEFolder",
parameterType="Required",
direction="Input")
# Sinuosity Field parameter
layers = arcpy.Parameter(
displayName="Layers",
name="layers",
datatype="String",
parameterType="Optional",
direction="Input",
multiValue = True)
parameters = [in_workspace, layers]
return parameters
def isLicensed(self): #optional
return True
def updateParameters(self, parameters): #optional
if parameters[0].altered:
global layerList
global dataLocation
path = str(parameters[0].value)
layerList = []
dataLocation = []
for root, dirs, files in os.walk(path):
for name in files:
if name.endswith(".lyr"):
layerList.append(name)
dataLocation.append(os.path.join(root,name))
parameters[1].filter.list = layerList
return
def updateMessages(self, parameters): #optional
return
def execute(self, parameters, messages):
for i in parameters[1].values:
arcpy.AddMessage("Adding: " + str(i))
mxd = arcpy.mapping.MapDocument("CURRENT")
lyrToAdd = i
indexPosition = layerList.index(lyrToAdd)
lyr = arcpy.mapping.Layer(dataLocation[indexPosition])
arcpy.mapping.AddLayer(mxd.activeDataFrame, lyr)
... View more
09-08-2014
11:21 AM
|
0
|
4
|
1712
|
POST
|
Hey Ken! I have written a quick sample that should do what you are looking for it to do. Enter in a directory in the first combo box and then press the drop down in the second to select the layer. Finally, press the button to add the layer to the map document. Does this help? Sample Code:
import arcpy
import pythonaddins
import os
global layerlist
global dataLocation
global buttonSelection
class ButtonClass5(object):
"""Implementation for Ken3_addin.button (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
mxd = arcpy.mapping.MapDocument("CURRENT")
lyrToAdd = buttonSelection
indexPosition = layerList.index(lyrToAdd)
lyr = arcpy.mapping.Layer(dataLocation[indexPosition])
arcpy.mapping.AddLayer(mxd.activeDataFrame, lyr)
class ComboBoxClass1(object):
"""Implementation for Ken3_addin.combobox (ComboBox)"""
def __init__(self):
self.items = []
self.editable = True
self.enabled = True
self.dropdownWidth = 'WWWWWW'
self.width = 'WWWWWW'
def onSelChange(self, selection):
pass
def onEditChange(self, text):
path = text
global layerList
global dataLocation
layerList = []
dataLocation = []
for root, dirs, files in os.walk(path):
for name in files:
if name.endswith(".lyr"):
layerList.append(name)
dataLocation.append(os.path.join(root,name))
print layerList
print dataLocation
def onFocus(self, focused):
pass
def onEnter(self):
pass
def refresh(self):
pass
class ComboBoxClass4(object):
"""Implementation for Ken3_addin.combobox_1 (ComboBox)"""
def __init__(self):
self.items = []
self.editable = True
self.enabled = True
self.dropdownWidth = 'WWWWWW'
self.width = 'WWWWWW'
def onSelChange(self, selection):
global buttonSelection
buttonSelection = selection
def onEditChange(self, text):
pass
def onFocus(self, focused):
self.items = layerList
def onEnter(self):
pass
def refresh(self):
pass
... View more
09-05-2014
03:48 PM
|
2
|
0
|
1712
|
POST
|
In addition, I believe that support is working on a series of blogs that help developers troubleshoot their scripts: JavaScript Debugging Tips – Google Chrome Network Tab | Support Services Blog
... View more
07-18-2014
09:48 AM
|
2
|
1
|
535
|
POST
|
Hi Sue, ArcGIS Online will let you help configure applications that are hosted on your own server but as far as uploading a template to ArcGIS Online for further modifications is not yet available. If you would like to see this functionality incorporated, I would go to the ideas website.
... View more
07-18-2014
09:47 AM
|
1
|
0
|
1017
|
POST
|
Hello Justin Medley, 1) What version of ArcMap are you using? (10.1, 10.2, ...) 2) What license level do you have for Arc Map? (Basic, Standard, Advanced) 3) What service packs do you have installed? 4) What operating system are you using? 5) What version is your book written for? I look forward to your response. Thanks!
... View more
07-17-2014
03:26 PM
|
1
|
2
|
683
|
POST
|
Hi Hemant Angarkar, Would you please send me a private message with some contact information so I can test this a little bit further? Thanks!
... View more
07-17-2014
03:23 PM
|
2
|
0
|
807
|
POST
|
Hi Nick Courtney, This functionality does not currently exist in ArcGIS Online. There is an official enhancement request logged under: [NIM098242 - Provide the ability to create custom class breaks when changing the symbology of a dynamic layer in ArcGIS Online.] I would also consider posting this enhancement request on the ideas page which our developers monitor frequently. In addition, other users are able to promote the idea which will add to the likelihood that it will be addressed in a future release. Here is a link to the ideas page: http://ideas.arcgis.com I hope this helps!
... View more
07-17-2014
03:21 PM
|
1
|
0
|
471
|
POST
|
Hi Evan Sepa, I believe that this is a known limitation of the Finder application as documented in its GitHub repository. This documentation stating this can be found here: Find, Edit, Filter documentation. local-government-online-apps/doc/markdown/BasicConfigurationOfFindEditFilter.md at master · Esri/local-government-online… Under the Result Display Field heading it reads: "Only one Result Display Field can be defined for each Find Layer." In addition, if you would like to see this enhancement made to the current template, you can post an enhancement request both directly to the GitHub Repository in addition to the Ideas website. I hope this helps!
... View more
07-17-2014
03:09 PM
|
2
|
1
|
482
|
POST
|
So I went through and reproduced using a domain that is derived from a subtype. Attached is an image that I recorded when I reproduced the issue. Hemant Angarkar - I sent you a private message regarding the status of this. Would you please message me back? Thank you!
... View more
07-17-2014
02:44 PM
|
1
|
2
|
807
|
POST
|
Correct. This was only using domains and not subtypes. I am going to test using a domain generated by a subtype next.
... View more
07-17-2014
02:36 PM
|
0
|
4
|
807
|
POST
|
Hi Joseph Rathvon To get the geocoders to work in your application outside of your organization, enable anonymous access in your organization. To do this, please do the following: Log in as an admin of your organization. Click "My Organization" in the top banner. Click "Edit Settings" above the list of users in your org. Click "Security" on the left hand side of your org settings page. Check the box on for Allow anonymous access to your organization. Does this help?
... View more
07-17-2014
02:08 PM
|
2
|
1
|
917
|
POST
|
1) What version of ArcMap are you using? (10.1, 10.2, ...) 2) What license level do you have for Arc Map? (Basic, Standard, Advanced) 3) What service packs do you have installed? 4) What operating system are you using? I just tried doing this in version 10.2.1 and was not able to reproduce the results that you are seeing.
... View more
07-17-2014
01:58 PM
|
1
|
6
|
807
|
POST
|
I do not believe so. Which template are you referring to specifically?
... View more
07-17-2014
01:44 PM
|
0
|
2
|
1017
|
Title | Kudos | Posted |
---|---|---|
1 | 07-15-2014 03:16 PM | |
1 | 01-06-2015 03:33 PM | |
1 | 12-02-2014 10:47 AM | |
1 | 07-15-2014 03:31 PM | |
1 | 09-23-2014 03:59 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|