|
POST
|
One more thing, is the else loop ever hit when you run this? Line 44 should have YES in quotes like it is on line 47.
... View more
01-07-2015
07:54 AM
|
0
|
1
|
1845
|
|
POST
|
The 'u' in front of the string values means the string has been represented as unicode. It is a way to represent more characters than normal ascii can manage. Source: python - What does the 'u' symbol mean in front of string values? - Stack Overflow Can you explain the title problem to me (problem 3)? I am a little confused what you mean by this.
... View more
01-07-2015
07:51 AM
|
1
|
1
|
1845
|
|
POST
|
Hi David, Try repairing your ArcGIS for Windows Mobile install and running the script again. Sometimes, it will grab the last python library installed. Did this help? Thanks! Alexander N.
... View more
01-06-2015
03:33 PM
|
1
|
1
|
583
|
|
POST
|
Hi Lesley, For some reason, I do not believe that this attribute is possible. If you take a look at the following screenshot I recorded, I turned on the modified property in catalog and raster data sets do not show any information for modified. I hope this helps!
... View more
01-05-2015
09:30 AM
|
1
|
1
|
472
|
|
POST
|
Hi Xander Bakker, Since I could reproduce the issue, I have logged the following defect: [BUG-000084246 - Checking out another license level in Python by default checks out the advanced license level.] Please keep in mind that I was only able to reproduce this in 10.3. You are correct in thinking this was available at 10.1 as it is clearly documented here: Accessing licenses and extensions in Python http://desktop.arcgis.com/en/desktop/latest/analyze/python/access-to-licensing-and-extensions.htm http://desktop.arcgis.com/en/desktop/latest/analyze/python/access-to-licensing-and-extensions.htm I hope this helps! Alexander N.
... View more
12-29-2014
09:13 AM
|
2
|
1
|
3743
|
|
POST
|
Hi Xander, I have noticed the same issue. I will further investigate this and get back to you! Thanks, Alexander N.
... View more
12-29-2014
08:58 AM
|
1
|
0
|
3743
|
|
POST
|
Hi Thomas, A couple of months ago I had the same problem and after some research found that the "Required" parameter property is read-only as documented here: Customizing tool behavior in a Python toolbox http://resources.arcgis.com/en/help/main/10.1/index.html#/Customizing_tool_behavior_in_a_Python_toolbox/00150000002m000000/ As a workaround, what I did was if a box was checked or textbox was filled in, I would use the addIDMessage and add error 735. AddIDMessage (arcpy) http://resources.arcgis.com/en/help/main/10.1/index.html#//018v00000022000000 000735 : <value>: Value is required. ArcGIS Help 10.1 What this did was that when the value was enabled, I could make the text box required and when the user went to run it, it would through an error asking for that value to be filled in. Does this help?
... View more
12-22-2014
03:10 PM
|
0
|
2
|
801
|
|
POST
|
Hi Matthew, Yes. The way to get this script to apply over multiple templates is to create a parameter in your script tool that would have something like a combo box or a filter added to select which template you would want. Then when that option is selected, set the templateMXD to that and pass everything else as you would before. Hope this helps!
... View more
12-17-2014
05:18 PM
|
1
|
0
|
512
|
|
POST
|
A lot of things have changed when moving to pro, most noticeable is the mapping module being renamed to mp. In addition, any map document will now be drilled down through the project and the individual layouts within those projects. What I was able to do is the following but it needs to be completed through the layout then map object: import arcpy
aprx = arcpy.mp.ArcGISProject("CURRENT")
layout1 = aprx.listLayouts('Layout')[0]
map1 = layout1.listElements('MAPFRAME_ELEMENT')[0]
map1.zoomToAllLayers(True) Not sure on refreshing the dataframe but that should be a good place to start. I hope this helps!
... View more
12-16-2014
04:00 PM
|
1
|
5
|
1322
|
|
POST
|
That I don't know, you may want to ask that question in a new forum post.
... View more
12-15-2014
04:49 PM
|
2
|
0
|
1280
|
|
POST
|
Yes. What you would need to do is grab the GUID of the table of contents and tell use that to turn the dockable window on or off. Here is a quick sample using C# and ArcObjects Addins. Tested at 10.2.2. using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ESRI.ArcGIS.Framework;
using ESRI.ArcGIS.esriSystem;
namespace ArcMapAddin10
{
public class Button1 : ESRI.ArcGIS.Desktop.AddIns.Button
{
public Button1()
{
}
protected override void OnClick()
{
//
// TODO: Sample code showing how to access button host
//
//ArcMap.Application.CurrentTool = null;
IApplication m_app = ArcMap.Application;
IDockableWindowManager pDocWinMgr = m_app as IDockableWindowManager;
UID uid = new UIDClass();
uid.Value = "{368131A0-F15F-11D3-A67E-0008C7DF97B9}";
IDockableWindow pTOC = pDocWinMgr.GetDockableWindow(uid);
if (pTOC.IsVisible())
{pTOC.Show(false);}
else { pTOC.Show(true); }
}
protected override void OnUpdate()
{
Enabled = ArcMap.Application != null;
}
}
} Shout out to Andrew Wang for the assistance in creating this sample. The following documentation should be helpful as well: IDockableWindow ArcObjects Help for .NET developers
... View more
12-15-2014
04:17 PM
|
1
|
2
|
1280
|
|
POST
|
Hi Dan Patterson & Curtis Price, In regards to using a python toolbox over a script tool please review the following docuentation which may provide some additional insight specifcally, this line: "In a Python toolbox, parameter definitions, validation code, and the source code are handled in the same place, making it easier to create and maintain Python tools. Additionally, Python toolboxes support capabilities that script tools do not, such as value tables, composite data types, and custom license checking." Comparing custom and Python toolboxes ArcGIS Help (10.2, 10.2.1, and 10.2.2) I hope this helps!
... View more
12-15-2014
08:36 AM
|
0
|
2
|
5009
|
|
POST
|
We have logged the following enhancement request for this issue: ENH-000083940 - Allow parameter dependencies between columns in a value table parameter in a python toolbox.
... View more
12-11-2014
08:19 AM
|
1
|
0
|
5009
|
|
POST
|
Hello Heath Brackett, The method call to get_org_users makes a REST call to: <PortalURL>/sharing/rest/portals/self/users where as the method call to get_user makes a REST call to: <PortalURL>/sharing/rest/community/users/<USERNAME> I hope this helps!
... View more
12-10-2014
09:33 AM
|
1
|
1
|
2123
|
|
POST
|
Hi Christina Heimburg, As we discussed in our phone conversation, this functionality is not yet possible with value tables. The code snippet that we used was the following as a workaround: import arcpy
class Toolbox(object):
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(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Tool with Value Table"
self.description = "Contains a model that you would like"
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
in_features = arcpy.Parameter(
displayName= "Input Feature Class",
name="in_features",
datatype="GPFeatureLayer",
parameterType="Optional",
direction="Input")
Fields = arcpy.Parameter(
displayName= "Field",
name="Fields",
datatype="GPString",
parameterType="Optional",
direction="Input")
value_table = arcpy.Parameter(
displayName = "Selected records",
name = "value_table",
datatype = "GPValueTable",
parameterType = "Optional",
direction="Input")
value_table.columns =([["GPString", "Feature Class"], ["GPString","Field"]])
params = [in_features, Fields, value_table]
return params
def isLicensed(self):
"""Set whether 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."""
if not parameters[0].hasBeenValidated and parameters[0].value:
#listOfFields = []
#fields = arcpy.Describe(parameters[0].value).fields
#for field in fields:
# listOfFields.append(field.aliasName)
parameters[1].filter.list = [f.name for f in arcpy.Describe(parameters[0].value).fields]
if not parameters[1].hasBeenValidated and parameters[1].value:
vtab = arcpy.ValueTable(len(parameters[2].columns))
if (parameters[2].valueAsText not in ('', ' ', None)):
vtab.loadFromString(parameters[2].valueAsText)
vtab.addRow('{0} {1}'.format(str(parameters[0].value), parameters[1].value))
parameters[2].value = vtab.exportToString()
parameters[1].value = ""
parameters[0].value = ""
parameters[1].filter.list = []
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."""
return
... View more
12-09-2014
03:37 PM
|
3
|
13
|
5009
|
| 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
|