|
POST
|
Hi Christina, could you please let me know which version of ArcGIS you are using? The original question was on 10.3.1.
... View more
07-19-2017
01:34 PM
|
0
|
1
|
566
|
|
POST
|
Where (how) are you getting the values of _featureLayer1 and _featureLayer2 - where are these variables defined? How are they defined. var _inpputs= new List<string>() { _featureLayer1, _featureLayer2 }; Are these Map layer objects obtained from a 'map' object - such as map.GetLayersAsFlattenedList() ... ? If so, you can call GetFeatureClass on both _featureLayer1 and _featureLayer2 as follows: _featureLayer1.GetFeatureClass() and _featureLayer2.GetFeatureClass() and use these feature classes instead.
... View more
07-17-2017
01:16 PM
|
0
|
0
|
2090
|
|
DOC
|
The document is rewritten in a blog - please visit that blog and share your ideas: https://community.esri.com/community/developers/gis-developers/python/blog/2017/07/17/python-addin-best-practices
... View more
07-17-2017
10:03 AM
|
0
|
0
|
1124
|
|
BLOG
|
A Python addin enables you to create custom button, tool, combobox on your custom toolbar and create your own extension in Python language. Use Esri's desktop and online documentation - it has all the information to get started, create, debug and maintain Python addins. However, I have seen users make mistakes that are hard to find or debug. So, I'm listing few guidelines which may save you time and in many cases get you out of trouble. Project Settings There is no restrictions on setting Project properties while creating an addin, however, having a good name for the project and an identifiable image as icon will help. Setting Toolbar properties Do not use any space in setting toolbar ID. Setting Extension properties Same rule applies for naming the ID variable. However, I suggest naming the class such that, when coding the script-behind, you know that it is a class - also, class name cannot contain space. Additionally, initially select only those methods that you'd need in your extension. Setting Button, Tool, ComboBox properties ID (Variable Name) is important - portion of the ID right to dot is the actual ID. This is very important as you use this ID to communicate with other controls (or extension) of the same add-in. The wizard gives generic button1, button2 names but when you write code for the controls you can be confused which does what - it will be easier if the ID itself contains clue. Using Global variables for communication between or among controls It is not well-advised to use global variables in Python - same advise applies to writing code for Python addins. Instead, you can use an Extension class with your own methods to facilitate communication. Or, you can have your own class to do the same. Please feel free to comment if you have suggestions for improvements of these suggestions.
... View more
07-17-2017
09:59 AM
|
3
|
0
|
1138
|
|
POST
|
Could you please put a break at this line and check what values do you get for valueArray variable when you step-over? var valueArray = await QueuedTask.Run(() => Geoprocessing.MakeValueArray(_inpputs, _outputFeatureClass, "ALL, "0", "POINT"));
... View more
07-13-2017
09:35 AM
|
0
|
1
|
2090
|
|
DOC
|
I guess some words were cut-off during upload. I'll update it.
... View more
07-13-2017
08:36 AM
|
0
|
0
|
1124
|
|
DOC
|
The document contains the most commonly useful links to getting started, documentation, how-tos, community information on Python add-ins on ArcGIS Desktop. Note: Python add-ins are not available on ArcGIS Pro.
... View more
07-10-2017
02:47 PM
|
0
|
3
|
2182
|
|
DOC
|
Please view the updated version in a blog format of this document here: https://geonet.esri.com/community/developers/gis-developers/python/blog/2017/07/17/python-addin-best-practices This doc outlines some uncommon but serious mistakes and suggests how to avoid those.
... View more
07-10-2017
02:41 PM
|
0
|
3
|
1715
|
|
POST
|
The tools run on the executing machine. However, the input and output come from the data source defined in the Python script (for script tool) or in ModelBuilder paths. If the path is set to one of the remote machines then data will come from or go to that particular machine.
... View more
07-10-2017
02:22 PM
|
1
|
0
|
1465
|
|
POST
|
Insert this line before your return statement: Geoprocessing.ShowMessageBox(result.Messages, "Intersect Messages",
result.IsFailed ? GPMessageBoxStyle.Error : GPMessageBoxStyle.Default); Let me know what returned messages do you see. You'll find some snippets in this link: https://github.com/ArcGIS/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing
... View more
07-05-2017
02:51 PM
|
0
|
3
|
2090
|
|
POST
|
Writing to in_memory should be faster if the computer has enough RAM.
... View more
05-26-2017
08:15 AM
|
1
|
0
|
398
|
|
POST
|
Your output should look like this: in_memory\Int%Name% And take off the .shp from name as output goes to a geodatabase, an extension of *.shp is invalid.
... View more
05-25-2017
02:15 PM
|
0
|
1
|
2079
|
|
POST
|
In memory data is stored in a in_memory geodatabase - I see you are trying to send your in_memory output to a folder - that's why your execution is failing. Just take the .shp off from your output name and try again.
... View more
05-25-2017
12:58 PM
|
0
|
1
|
2079
|
|
POST
|
Here is a way to do it - just remember to pass the whole path to the model tool including the Model's name. namespace TestModelRun { internal class RunModelTool : Button { protected override async void OnClick() { await ExecuteModel(); } public async Task<IGPResult> ExecuteModel() { // This is important - pass the path to toolbox and the model tool name as a combined string string tool_path = System.IO.Path.Combine(@"E:\sdk\MyProject27\MyProject27.tbx", "Model"); // This tool takes only one parameter var parameters = Geoprocessing.MakeValueArray("E:\\data\\gdbs\\mexico.gdb\\mexicoCity_Proj"); // Execute the tool IGPResult gp_result = await Geoprocessing.ExecuteToolAsync(tool_path, parameters); // display all GP messages Geoprocessing.ShowMessageBox(gp_result.Messages, "GP Messages", gp_result.IsFailed ? GPMessageBoxStyle.Error : GPMessageBoxStyle.Default); return gp_result; } } } For details visit the SDK help section for Geoprocessing at: https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Geoprocessing
... View more
05-12-2017
03:33 PM
|
2
|
0
|
724
|
|
POST
|
Check this thread out: https://community.esri.com/thread/120553
... View more
04-20-2017
04:38 PM
|
0
|
0
|
978
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-18-2019 03:56 PM | |
| 1 | 05-06-2020 01:18 PM | |
| 1 | 07-23-2021 10:33 AM | |
| 1 | 07-28-2020 09:10 AM | |
| 2 | 07-27-2020 04:47 PM |
| Online Status |
Offline
|
| Date Last Visited |
10-25-2021
03:13 PM
|