|
POST
|
Hi Karen. I am using ArcGIS Pro 2.4.3 and code I copied earlier works for me with all versions from 2.0. Maybe your file geodatabase has some special components such as geometry network, topology, relationship classes or etc.? My file geodatabase contains only feature datasets, feature classes and tables.
... View more
12-29-2019
11:28 PM
|
0
|
0
|
4110
|
|
POST
|
Hi Karen, I add some parts of my code. One with new connection and next one with layer adding: public static Task ChangeFeatureLayerDataConnectionAsync(FeatureLayer featureLayer, string catalogPath) { return QueuedTask.Run(() => { CIMDataConnection currentDataConnection = featureLayer.GetDataConnection(); string connection = System.IO.Path.GetDirectoryName(catalogPath); string suffix = System.IO.Path.GetExtension(connection).ToLower(); WorkspaceFactory wf = WorkspaceFactory.FileGDB; if (suffix == ".sde") { wf = WorkspaceFactory.SDE; } string dataset = System.IO.Path.GetFileName(catalogPath); var dbGdbConnection = new FileGeodatabaseConnectionPath(new Uri(connection, UriKind.Absolute)); // provide a replace data connection method CIMStandardDataConnection updatedDataConnection = new CIMStandardDataConnection() { WorkspaceConnectionString = new Geodatabase(dbGdbConnection).GetConnectionString(), WorkspaceFactory = wf, Dataset = dataset, DatasetType = esriDatasetType.esriDTFeatureClass }; featureLayer.SetDataConnection(updatedDataConnection); //Bug #2, we manually invalidate the cache featureLayer.ClearDisplayCache(); }); } FetureLayer featLayer = (FeatureLayer)LayerFactory.Instance.CreateLayer(new Uri(sLyrPath), map); ChangeFeatureLayerDataConnectionAsync(featLayer, sDatabase + "\\" + sTableName); If it will not change your geodatabase locking status, so the problem is in writing to database. Good luck.
... View more
12-19-2019
10:45 PM
|
0
|
6
|
4110
|
|
POST
|
Hi Karen, Few lines were In ArcGIS Pro sample with SetDataConnection (after SetDataConnection call): //Bug #2, we manually invalidate the cache newlayer.ClearDisplayCache(); We use them in workspace loading tool which loads all feature classes with predefined lyr files and have no problems with database locking. I hope it will help.
... View more
12-17-2019
11:12 PM
|
0
|
8
|
4110
|
|
POST
|
Hi, You can't update raster layer because it is locked. You need to remove layer from TOC, make SaveAs call and add raster back to TOC.
... View more
12-17-2019
12:21 AM
|
0
|
0
|
1054
|
|
POST
|
Hi Than, Try to add line of code before calling SaveAs: rasterStorageDef.SetCellSize(rasterInfo.CellSize, rasterInfo.CellSize);
... View more
12-13-2019
01:12 AM
|
0
|
3
|
2986
|
|
POST
|
Dear colleagues from Esri, Most calculation or database management functions in ArcGIS Pro SDK are realized using geoprocessing. All information you can get about geoprocessing functions: - ArcGIS Pro API reference (about Geoprocessing.ExecuteToolAsync and etc.) - ArcGIS Pro Snippets ( about "management.CopyFeatures", "Analysis.MultipleRingBuffer" and "Analysis.Buffer") - other ArcGIS documentation with ArcPy samples. What to do for ArcGIS Pro SDK .Net developer? Run geoprocessing tool from ArcGIS Pro, copy from history arcpy code of executed tool, solve rebus how to convert geoprocessing tool name from arcpy to .Net, how to arrange parameters especially list and etc.? For example spatial analyst Euclidean distance tool. Arcpy script from history looks like this: out_distance_raster = arcpy.sa.EucDistance(r"Sites", 1000, 50, None, "PLANAR", None, None); out_distance_raster.save(r"C:\CellExp\Tutorial\ProTest\Pro\MyProject5.gdb\EucDist_Site1") First idea is to check geoprocessing results. It is wrong way. You need somehow to understand that result raster name must be second parameter after featureclass name. Looks strange but it works. In snippet mentioned above ("Analysis.Buffer") you can find geoprocessing flag GPExecuteToolFlags.GPThread. Try to use that flag with Euclidean distance. You will wait for results of Euclidean distance all your life and you will never get results. I had a problem few ArcGIS Pro releases ago and solving of problem was GPExecuteToolFlags.GPThread flag adding. When that flag is useable when not? Could you please make a table with all available geoprocessing functions for .Net developers with arguments or make some notes where are differences between arcpy and .Net calling, explain more complicated arguments converting from arcpy to .Net and put it on ArcGIS Pro API reference, ArcGIS Pro SDK GitHub or somewhere else. One more line about ArcGIS Pro API reference on internet. Open it with MS Explorer, Edge and press "Search" button at the bottom of left corner. Search input line appears after 0,5-1 minute. In our country we have one of the fastest internet network and it is not a internet speed problem. Other internet browsers I have not tried.
... View more
12-11-2019
02:47 AM
|
4
|
9
|
4901
|
|
POST
|
Hi Than, What type is your rasterInfo.CellSize variable? Try to set constant value first (5,10 or 50). And you don't need to convert MakeValueArray arguments to string. They are all object type. MakeValueArray checks argument types itself and converts how it needs. After MakeValueArray you can check parameters variable with debugger watch and see what value for cell size was defined.
... View more
12-10-2019
11:09 PM
|
0
|
5
|
2986
|
|
POST
|
Hi Than, I think you need to save your raster to get updated properties. Look at this link: https://community.esri.com/thread/213505-raster-setwidth-not-working
... View more
12-09-2019
03:52 AM
|
0
|
7
|
2986
|
|
POST
|
In ArcGIS Pro database structure editing, raster creation and analysis and much more functionality are realized using geoprocessing. For small task it is enough, but for big applications it takes a lot time to start geoprocessing. To troubleshoot geoprocessing check geoprocessing messages after executing tool: // gp_result is the returned result object from a call to ExecuteToolAsync // displays error messages if the tool fails, otherwise shows the default messages Geoprocessing.ShowMessageBox(gp_result.Messages, "GP Messages", gp_result.IsFailed ? GPMessageBoxStyle.Error : GPMessageBoxStyle.Default); More info: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Geoprocessing Other questions could be answered by Esri stuff only
... View more
12-02-2019
10:53 PM
|
2
|
1
|
2838
|
|
POST
|
Hi Than, Sample code: IReadOnlyList<string> parameters = Geoprocessing.MakeValueArray("D:\Temp\Test", // Output path "Result", // Raster name 50, // Cellsize "8_BIT_UNSIGNED", // pixel type spatRef, // Spatial reference, 1); // Bands count IReadOnlyList<KeyValuePair<string, string>> environments = Geoprocessing.MakeEnvironmentArray(extent: pEnvelope); var gpResult = Geoprocessing.ExecuteToolAsync("CreateRasterDataset_management", parameters, environments, CancelableProgressor.None, GPExecuteToolFlags.GPThread); gpResult.Wait(); More info about parameters and environment here: https://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-raster-dataset.htm And forget about ArcObjects when you are working with ArcGIS Pro.
... View more
11-28-2019
10:47 PM
|
2
|
3
|
2838
|
|
POST
|
Hi Than, You can do it in ArcGIS Pro SDK .Net using geoprocessing: var gpResult = Geoprocessing.ExecuteToolAsync("CreateRasterDataset_management", ..., ..., ..., ..., ...); If you want to get help with ArcGIS Runtime sdk you are in the wrong forum. You can get more feedback in ArcGIS Runtime sdk forums.
... View more
11-27-2019
11:29 PM
|
1
|
5
|
2838
|
|
POST
|
Hi Elizabeth, At first check what you have in your pWorkspace. Add code using: public IEnumDataset get_Datasets ( esriDatasetType DatasetType ); parameter esriDTTable. Using Next() from IEnumDataset check all datasets in your workspace. If you find your CSVFile dataset, you can cast it to ITable. Otherwise your csv does not exist or it is wrong.
... View more
11-26-2019
12:22 AM
|
0
|
1
|
1640
|
|
POST
|
Hi Simon, To apply symbology from lyr/lyrx file you need to use geoprocessing: var parameters = Geoprocessing.MakeValueArray(featLayer, lyrFilePath); var gpResult = Geoprocessing.ExecuteToolAsync("ApplySymbologyFromLayer_management", parameters, null, null, null, GPExecuteToolFlags.GPThread);
... View more
11-25-2019
11:28 PM
|
0
|
0
|
1661
|
|
POST
|
Hi Thomas, I have created new project and classes with your names. StepperBackstagePane works fine for me from Add-in button. protected async override Task InitializeAsync() { UrlHeight = "xxx"; await base.InitializeAsync(); } Check config.daml file for pane className and content className attributes. They must match your classes. I have had similar problem when I tried to rename esri sample source code. <pane id="Stepper_MVVM_StepperBackstagePane" caption="StepperBackstagePane" className="StepperBackstagePaneViewModel" smallImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonGreen16.png" defaultTab="esri_mapping_homeTab" defaultTool="esri_mapping_navigateTool"> <content className="StepperBackstagePaneView" /> </pane> I don't know your application architecture so I have not checked other content (FaksBackstageTabViewModel and etc.) I have tried to go deep. From backstage Stepper button StepperBackstagePane does not work as you wrote. In way you create StepperBackstagePane it does not get InitializeAsync() event. You need to create your own constructor or modify existing to read settings. Pane you created is not usable for your solution. It is designed as ArcGIS Pro Map pane or Attribute table table pane. It has own way of pane creating.
... View more
11-07-2019
06:23 AM
|
0
|
0
|
3372
|
|
POST
|
Hi Thomas, Could you please make a copy from xaml of texbox control. If debugger never goes inside InitializeAsync then problem is with DataContext of your page. It does not found your view model. Check xaml header: d:DataContext="{Binding Path=YourPageViewModel}"
... View more
11-07-2019
01:05 AM
|
0
|
2
|
3372
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 3 weeks ago | |
| 1 | 06-30-2026 10:14 PM | |
| 1 | 06-30-2026 01:43 PM | |
| 2 | 04-24-2026 08:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|