POST
|
Are you saying in order to send it back to .NET or in order to specify the path? I have used it to specify the path and file and it doesn't work. I'm not sure how to send that back to the SDK source and then parse it.
... View more
08-02-2019
11:50 AM
|
0
|
1
|
1618
|
POST
|
I've tried both ways. Neither work. It only will work if that layer is added to the map.
... View more
08-02-2019
11:30 AM
|
0
|
3
|
1618
|
POST
|
I thought I responded to you already, but I guess it didn't post. Yes I am using the SDK to execute the python script. That's what the ExecuteToolAsync() does. I do not know how to get the results from the python script back to the SDK solution though. If you figure it out let me know please .
... View more
08-02-2019
11:22 AM
|
0
|
5
|
1618
|
POST
|
It also would mean I would have to create 2 separate python tools. One to create the layer, then use sdk code to ad it then execute a 2nd to run the process that I want.
... View more
08-02-2019
10:58 AM
|
0
|
4
|
774
|
POST
|
I shouldn't need to manually add the layer via sdk given that the ExecuteToolAsync is supposed to add the layer when it creates it. Using that means I have to generate the filename on the c#side or return it from my python tool. Do you know how to return it? In python I know how to generate unique file names, not in c# or the arcgis pro sdk.
... View more
08-02-2019
10:57 AM
|
0
|
7
|
1618
|
POST
|
I have created a tool with python that I am running from an add-in using Geoprocessing.ExecuteToolAsync. My code gets the (x,y) center of the current map extent and makes x,y event layer from that point. I then attempt to run arcpy.conversion.LayerToKML tool. What I am finding is that the layer I create never gets added to the map/project even though I have tried specifying "GPExecuteToolFlags.AddOutputsToMap" and "GPExecuteToolFlags.Default ", which both are supposed to add all resulting layers to the map. The LayerToKML tool doesn't work if the layer being used isn't added to the project. I can get the code to run and create the layer that I want and save it using SaveToLayerFile_mangement, but how do I get it to add to the map. I have looked at the documentation extensively and haven't found anything helpful. Also I know the LayerToKML tool works through the ExecuteToolAsync because I can run it by itself (commented out other code and ran on layer added to map after creating with 1st part of script). var xE = middlePoint.X.ToString();
var yE = middlePoint.Y.ToString();
var parameters = Geoprocessing.MakeValueArray(xE, yE)
string tool_path = @"PATH\Jwtools.tbx\Script";
var progDlg = new ProgressDialog("Running Geoprocessing Tool", "Cancel", 100, true);
var progSrc = new CancelableProgressorSource(progDlg);
progDlg.Show();
var gp_result = await Geoprocessing.ExecuteToolAsync(tool_path, parameters, null, new CancelableProgressorSource(progDlg).Progressor, GPExecuteToolFlags.AddOutputsToMap);
Geoprocessing.ShowMessageBox(gp_result.Messages, "GP Messages", gp_result.IsFailed ? GPMessageBoxStyle.Error : GPMessageBoxStyle.Default);
progDlg.Hide();
... View more
08-02-2019
08:34 AM
|
1
|
16
|
2680
|
POST
|
Margaret, I created a template in Arcmap with 2 data frames. I then added my layers to both data frames(There is likely a more efficient way to do this, but since I was only using 10 layers I did it this way). In the python script I used the web map as json format to fake a webmap in. I then used the ConvertWebMapToMapDocument tool to create a print. Web_Map_as_JSON = { "mapOptions": { "extent": { "xmin": -121.2525, "ymin": 47.3671, "xmax": -122.8498, "ymax": 46.7341, "spatialReference": { "wkid": 2927, "latestWkid": 2927 } }, }, "operationalLayers": [], "baseMap": { "title": "cartoRoads", "baseMapLayers": [ { "id": "cartoRoads_1751", "layerType": "ArcGISTiledMapServiceLayer", "url": "", "visibility": true, "opacity": 1, "title": "cartoRoads" } ] }, "exportOptions":{}, "layoutOptions":{}, "authoringApp": "WebMapViewer", "authoringAppVersion": "6.2", "version": "2.12", "applicationProperties": { "viewing": { "routing": { "enabled": true }, "measure": { "enabled": true }, "basemapGallery": { "enabled": true } } } } ###The webmap_as_json parameter isn't really that important if you're using your own template. templateMxd = (r'\\'filePATH'\TestLayout.mxd') result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, templateMxd) mxd = result.mapDocument ImgLayer1 = sys.argv[1]#(This is simply the name of the layer sent as a string) ImgLayer2 = sys.argv[2] ImgLayer3 = sys.argv[3] ExtentInYMax = sys.argv[4] ExtentInYMin = sys.argv[5] ExtentInXMax = sys.argv[6] ExtentInXMin = sys.argv[7] df1 = arcpy.mapping.ListDataFrames(mxd)[1] newExtent = df1.extent newExtent.XMin, newExtent.YMin = ExtentInXMin, ExtentInYMin newExtent.XMax, newExtent.YMax = ExtentInXMax, ExtentInYMax df1.extent = newExtent layers1= ListLayers(df1) for layer in layers1: restLayer = "rest - "+layer.name; if restLayer == ImgLayer1: layer.visible = True You can then turn layers on/off(Or add them from an outside location if possible), change extent etc. of each dataframe. Check the documentation at http://desktop.arcgis.com/en/arcmap/10.6/analyze/arcpy-mapping/convertwebmaptomapdocument.htm
... View more
07-18-2019
03:29 PM
|
0
|
1
|
2317
|
POST
|
Nate, Are you using the Web App Builder Developer Edition? It sounds like you are using the online version.
... View more
07-15-2019
08:37 AM
|
0
|
0
|
598
|
POST
|
I thought I replied to this earlier. Welp it looks like there is not support for a locator service at this time. Thanks for your help though!
... View more
06-20-2019
02:45 PM
|
0
|
0
|
1800
|
POST
|
I get "Locator is not available on the current portal."
... View more
06-20-2019
07:26 AM
|
0
|
0
|
1800
|
POST
|
I'm using Version 2.3.3. When I open the Locators menu it if I click the locator it has a red ! next to the Locator I'm attempting to add. Also the folder name isn't there.
... View more
06-19-2019
03:08 PM
|
0
|
2
|
1800
|
POST
|
Yes it seems to be adding it, but it is just greyed out.
... View more
06-19-2019
02:54 PM
|
0
|
4
|
1800
|
POST
|
One thing I noticed is when I hover over the connection at the end there is an extra '/' so instead of saying /{locatorName}.GeocodeServer it says /{locaterName}.GeocodeServer/
... View more
06-19-2019
02:52 PM
|
0
|
1
|
1800
|
Title | Kudos | Posted |
---|---|---|
1 | 12-26-2018 10:22 AM | |
1 | 08-16-2018 08:51 AM | |
1 | 04-19-2018 02:22 PM | |
1 | 02-12-2019 10:47 AM | |
1 | 12-11-2018 10:00 AM |
Online Status |
Offline
|
Date Last Visited |
09-13-2023
07:38 PM
|