|
POST
|
Hi, Have tried EditOperation Split, SplitAtPoint, SplitAtPoints methods? More info here: https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic20421.html API reference show less methods than intellisense.
... View more
04-26-2022
07:06 AM
|
1
|
9
|
2945
|
|
POST
|
Hi, I will not use Geoprocessing at all. Open raster and make SaveAs from ArcObjects. It is very simple. I have no possibility to check VB code, but it could be like this: Dim oRaster As IRaster
Dim pRasterWSX As IRasterWorkspaceEx
Dim strWorkspaceLocation as String
Set strWorkspaceLocation = "C:\data\mygeodatabase.gdb"
Set pWSFact = New FileGDBWorkspaceFactory
If pWSFact.IsWorkspace(strWorkspaceLocation) Then
Set pRasterWSX = pWSFact.OpenFromFile(strWorkspaceLocation, 0)
Set rDataset = pRasterWSX.OpenRasterDataset("rastername")
Set oRaster = rDataset.CreateDefaultRaster
Set rDataset = Nothing
Set pRasterWSX = Nothing
Dim rasterBC As IRasterBandCollection
Set rasterBC = oRaster
Dim pWKSfactory As IWorkspaceFactory
Set pWKSfactory = New RasterWorkspaceFactory
Set pSaveWorkspace = pWKSfactory.OpenFromFile("C:\Data", 0)
rasterBC.SaveAs "outputraster.tif", pSaveWorkspace, "TIFF"
Set rasterBC = Nothing
Set pWKSfactory = Nothing
Set pSaveWorkspace = Nothing
End If
Set pWSFact = Nothing
... View more
04-25-2022
06:56 AM
|
0
|
0
|
818
|
|
POST
|
I don't know what you exactly mean "use while-LOOP for only one pass". If you want to get only one feature, you can change "while" to "if". If you want to go through selection few times, so you need each time make new search. Cursor works one time only
... View more
04-25-2022
03:59 AM
|
0
|
0
|
1491
|
|
POST
|
Hi, You need to get cursor from selection: using (var rowCursor = gsSelection.Search(null))
{
while (rowCursor.MoveNext())
{
using (var polyFeature2 = rowCursor.Current as Feature)
{
// Your code here
}
}
}
... View more
04-25-2022
01:58 AM
|
0
|
2
|
1506
|
|
POST
|
Hi, First thing, move 18-19 line before line 12. This is performance issue. Second thing, EditOperation Execute method could be called only once. You call it in a cycle. There is 2 solution methods: - move createOperation inside cycle. - move Execute calling outside cycle. Third thing. Store in 45 line could be used in EditOperation with callback. Mixing of different EditOperation approaches is not legal. You can use Modify method from EditOperation and call Execute after Modify (depending on the way you choose in second sugesstion). In some cases you can use chained operation. More information here: https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#performing-edits-in-pro
... View more
04-21-2022
06:32 AM
|
1
|
1
|
2165
|
|
POST
|
Hi, I think your question is on a wrong thread. You need to move it to: https://community.esri.com/t5/arcgis-pro-sdk/ct-p/arcgis-pro-sdk
... View more
04-21-2022
02:57 AM
|
0
|
1
|
898
|
|
POST
|
Hi, I don't use that code and didn't check all cases;. I only wanted to show you the way how to do your task. Try to save previous state of dockpane and check if it changes. then do not react.
... View more
04-19-2022
02:53 AM
|
0
|
0
|
4244
|
|
POST
|
There is method for geometry serializing: - IExternalSerializerGdb.WriteGeometry Method (ArcObjects .NET 10.8 SDK) (arcgis.com)
... View more
04-18-2022
10:22 PM
|
0
|
1
|
3276
|
|
POST
|
Hi, If you use ArcObjects .NET SDK 10.8 you can use JSONConverterGdb class . I don't know if it is available in earlier versions. Another way is to use .NET serializer: public static string To<T>(T obj)
{
string retVal = null;
System.Runtime.Serialization.Json.DataContractJsonSerializer serializer = new System.Runtime.Serialization.Json.DataContractJsonSerializer(obj.GetType());
using (MemoryStream ms = new MemoryStream())
{
serializer.WriteObject(ms, obj);
retVal = Encoding.Default.GetString(ms.ToArray());
}
return retVal;
}
... View more
04-14-2022
10:35 PM
|
0
|
3
|
3298
|
|
POST
|
Hi, Code behind of Dockpane is based on UserControl so you can’t listen OnClosing event or something similar. I have attached modified ArcGIS Pro SDK community sample (ContentFileExplorer). This is not brilliant solution which needs many different techniques in code behind and mvvm. But it works (I think)
... View more
04-14-2022
08:01 AM
|
0
|
2
|
4271
|
|
POST
|
Hi, How to handle loaded event in WPF here: https://docs.microsoft.com/en-us/dotnet/desktop/wpf/advanced/how-to-handle-a-loaded-event?view=netframeworkdesktop-4.8 You can set ProWindow position in xaml or in code. ProWIndow is derived from Window. In xaml you can use WindowStartupLocation: <controls:ProWindow x:Class="YourWindowView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:ArcGIS.Desktop.Framework.Controls;assembly=ArcGIS.Desktop.Framework"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
mc:Ignorable="d"
Title="Window name" MinWidth="550"
WindowStartupLocation="CenterOwner"
d:DataContext="{Binding Path=vm.YourWindowViewModel}"
SizeToContent="Height" Width="550"
> It has few alternatives. More info here: https://docs.microsoft.com/en-us/dotnet/api/system.windows.window.windowstartuplocation?view=netframework-4.8 In code you can do like this: var window = new YourProWindow();
window.Left = 100;
window.Top = 100;
window.ShowDialog();
... View more
04-11-2022
05:34 AM
|
1
|
1
|
1497
|
|
POST
|
Hi, My ArcGIS Pro Community SDK sample has all references, but it does not show page content.
... View more
04-06-2022
10:16 PM
|
0
|
0
|
8004
|
|
POST
|
Hi, Use the same approach as in line 8. You can pass to MakeValueArray everything. var lyrCrossings = map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(l => l.Parent.ToString() == "Group" && l.IsVisible == true).ToList();
var inputList = Geoprocessing.MakeValueArray(lyrCrossings, secondPath);
var args = Geoprocessing.MakeValueArray(inputList, outputPath, "", "", "POINT");
string toolPath = "analysis.Intersect";
var result = await Geoprocessing.ExecuteToolAsync(toolPath, args, environments); If you want to know what exactly takes geoprocessing tool from your layer then you need to execute geoprocessing directly from ArcGIS Pro and copy Python script from History record.
... View more
04-06-2022
10:09 PM
|
0
|
0
|
1418
|
|
POST
|
Hi, Have you tried Query Layers? The description of the query layers is on the same page as your QueryTable link. Just below few lines. Code is very similar. Example below is from ArcGIS Pro SDK samples: private void MakeQueryLayer(string commaSeparatedFields, Table leftTable, Table rightTable)
{
string fields = string.IsNullOrEmpty(commaSeparatedFields) ? "*" : commaSeparatedFields;
var database = leftTable.GetDatastore() as Database;
var joinClause = IsLeftOuterJoin
? $"{leftTable.GetName()} LEFT OUTER JOIN {rightTable.GetName()} ON {leftTable.GetName()}.{_leftField.Name} = {rightTable.GetName()}.{_rightField.Name}"
: $"{leftTable.GetName()} INNER JOIN {rightTable.GetName()} ON {leftTable.GetName()}.{_leftField.Name} = {rightTable.GetName()}.{_rightField.Name}";
var queryDescription = database.GetQueryDescription($"SELECT {fields} FROM {joinClause}", LayerName);
var table = database.OpenTable(queryDescription);
LayerFactory.Instance.CreateFeatureLayer(table as FeatureClass, MapView.Active.Map, 0, LayerName);
} All sample code here: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Geodatabase/DynamicJoins
... View more
04-06-2022
06:31 AM
|
1
|
0
|
1181
|
|
POST
|
Hi, You need to add your cursor file to visual studio project as resource. Instead of "MapExploration.Resource1.red_cursor" use Properties.Resources.<your_cursor_resource-name>
... View more
04-04-2022
07:14 AM
|
1
|
1
|
3405
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 1 | a week ago | |
| 2 | 04-24-2026 08:33 AM | |
| 1 | 03-23-2026 11:44 AM | |
| 1 | 05-22-2024 11:48 PM |
| Online Status |
Online
|
| Date Last Visited |
a week ago
|