|
POST
|
@JohnnyHarley12 , it looks like the instructions are missing an important step after you insert the layout construction code into the OnClick method. You can let Visual Studio fix the problem for you by right clicking on the error and selecting "Quick Actions and Refactorings ..." Or you can simply fix the OnClick method definition to this: protected override async void OnClick() We'll fix the issue for the next release.
... View more
10-25-2022
05:03 AM
|
0
|
0
|
1201
|
|
POST
|
To test your snippet i used the following code to define the envelope: var env = MapView.Active.Extent;
(xMax, yMax) = (env.XMax, env.YMax);
(xMin, yMin) = (env.XMin, env.YMin); This works for me, but the graphic i get is a bow tie. Because you don't get a graphic at all, i assume that your projection for your a, b, c and d values needs to be defined. I don't know what your projection is, but you have to add it here: Polygon poly = PolygonBuilderEx.CreatePolygon(plyCoords, map.SpatialReference); Replace map.SpatialReference with the spatial reference for your corner coordinates. I.e. SpatialReferences.WGS84 if you are using lat/long.
... View more
10-24-2022
06:12 AM
|
0
|
1
|
733
|
|
POST
|
I will try with 2.5 and use your path values. It looks like you are setting locationpath to the default project location. On those machines where this doesn't work you can create a new project (using any template) from within Pro?
... View more
10-06-2022
11:13 AM
|
0
|
0
|
1392
|
|
POST
|
There is one issue i ran into while testing this. Apparently the given 'LocationPath' has to exist otherwise Pro will use the default project path. You could change your code snippet a bit to prevent this problem: var cps = new CreateProjectSettings()
{
Name = defaultName,
LocationPath = DefaultFolder(),
TemplatePath = GetDefaultMapTemplate(),
CreateNewProjectFolder = true
};
if (!System.IO.Directory.Exists(cps.LocationPath))
System.IO.Directory.CreateDirectory(cps.LocationPath);
//ProMapBlackLogWriter.Log.Debug("NewBlankProject - CreateAsync");
var newProject = await Project.CreateAsync(cps); //This Fails with log. And has not happened before
... View more
10-06-2022
10:41 AM
|
0
|
1
|
1397
|
|
POST
|
It appears that UnpackProjectPackage is failing. Once a template is chosen, ArcGIS Pro is trying to 'unzip' the new ArcGIS Pro project file (from the template) in the destination location path. In order to determine what went wrong you should log both defaultName and DefaultFolder() when CreateAsync fails. And we need the value for GetDefaultMapTemplate() too in order to see if the template file exists. I am trying to duplicate this issue, what version of Pro are you using?
... View more
10-06-2022
07:59 AM
|
0
|
1
|
1425
|
|
POST
|
You can also use the CIMViewer add-in to inspect the composition of your layer symbology. A download for 3.0 is available here: Release ArcGIS Pro 3.0 SDK for .NET · Esri/arcgis-pro-sdk-cim-viewer (github.com) If you run ArcGIS Pro 2.x you have to clone the CIMViewer repo's source code and build the 2.x esriaddinx. The 2.x CIMViewer solution is called: CIMViewer.sln in the same GitHub repo.
... View more
09-30-2022
01:41 PM
|
0
|
0
|
1630
|
|
POST
|
I attached two sample solutions that show how to remote start and remote control ArcGIS Pro from an ArcGIS Corehost application. This sample is comprised of two samples: Corehost server application that starts and controls the ArcGIS Pro client: ArcGISProConfigCoreHost ArcGIS Pro client application that is started and controlled: ArcGISProConfig To use the sample: 1. Make sure this project is available: "C:\Data\FeatureTest\FeatureTest.aprx" or change the path in the Corehost application. 1. Run the client application: ArcGISProConfigCoreHost 1. Note that the AppDomain is modified on startup to resolve the Assembly Paths for ArcGIS.Core.dll and ArcGIS.CoreHost.dll by using the ArcGIS Pro installation location. 1. The ArcGISProConfigCoreHost console application starts ArcGIS Pro with the "ArcGISProConfig" Managed Configuration 1. Once ArcGISProConfig has started and is ready, ArcGISProConfigCoreHost sends the project path: "C:\Data\FeatureTest\FeatureTest.aprx" to be opened 1. ArcGISProConfig opens the project 1. Once the output stops press any key to close the application. 1. Close the "ArcGISProConfig" client session (ArcGIS Pro) using the User Interface. Note that closing can be automated as well. 1. The "ArcGISProConfigCoreHost" Corehost application terminates after ArcGIS Pro has been closed.
... View more
09-30-2022
10:26 AM
|
0
|
0
|
1390
|
|
POST
|
Depending on the datatype of ckey field you might have to change your syntax so that: WhereClause = $@"ckey = {Ckey}", could turn into this: WhereClause = $@"ckey = '{Ckey}'", Needless to say the field 'ckey' must exists in the table "TableName"
... View more
09-29-2022
04:19 PM
|
1
|
0
|
849
|
|
POST
|
i think you would start ArcGIS Pro (from a console app) using a Configuration. The Configuration extension option allows you to write custom code for the start sequence (i.e. loading a project, zoom in, add layers etc.), and then either look at instructions in a file or use some type of Inter Process Communication between you two processes. So in essence this would allow you to automate some ArcGIS Pro (Desktop app) processing. Here is more information on Configurations in case you are not familiar: ProConcepts Configurations · Esri/arcgis-pro-sdk Wiki (github.com) I will try to write some sample code that shows this type of workflow and post it here.
... View more
09-26-2022
06:11 PM
|
0
|
0
|
1410
|
|
POST
|
Your code snippet doesn't change the FeatureLayer definition, instead it only reads it. I found this snippet in our community samples that updates the labeling. You can see how to update the layer definition (Esri/arcgis-pro-sdk-community-samples: ArcGIS Pro SDK for Microsoft .NET Framework Community Samples (github.com) ).: private async Task<CIMLabelClass> CreateAndApplyLabelClassAsync(FeatureLayer featureLayer, string oidField, List<long> oids)
{
var labelClass = await QueuedTask.Run(() =>
{
var labelSelectedFeaturesWithLength = new CIMLabelClass
{
Name = "LabelSelectedFeaturesWithLength",
ExpressionEngine = LabelExpressionEngine.Arcade,
Expression = "$feature.MILES",
WhereClause = $"{oidField} IN ({String.Join(", ", oids.ToArray())})",
TextSymbol = SymbolFactory.Instance.ConstructTextSymbol().MakeSymbolReference(),
Visibility = true
};
var lyrDefn = featureLayer.GetDefinition() as CIMFeatureLayer;
var listLabelClasses = lyrDefn.LabelClasses.ToList();
listLabelClasses.Add(labelSelectedFeaturesWithLength);
lyrDefn.LabelClasses = listLabelClasses.ToArray();
featureLayer.SetDefinition(lyrDefn);
return labelSelectedFeaturesWithLength;
});
return labelClass;
}
... View more
09-21-2022
01:54 PM
|
0
|
0
|
1499
|
|
POST
|
Stephen, you can also use a pre-defined arrow symbol using this code: if (_lineSymbol == null)
{
//Get all styles in the project
var styleProjectItem2D = Project.Current.GetItems<StyleProjectItem>().FirstOrDefault(s => s.Name == "ArcGIS 2D");
await QueuedTask.Run(() =>
{
//Get a specific project style by name
var arrowLineSymbol = styleProjectItem2D.SearchSymbols(StyleItemType.LineSymbol, "Arrow Line 2 (Mid)")[0];
if (arrowLineSymbol == null) return;
_lineSymbol = arrowLineSymbol.Symbol;
});
} The example symbology will look like this: I attached a sample tool code snippet that shows the symbology using a graphic overlay. EDIT: please substitute the SearchSymbol string using the following to get an arrow at the end: styleProjectItem2D.SearchSymbols(StyleItemType.LineSymbol, "Bold Arrow 2")[0];
... View more
09-21-2022
12:42 PM
|
0
|
1
|
2141
|
|
POST
|
You say: I would like to edit the parts in red rectangles in that base layer. But then you also say: find the parts in one polyline layer and edit the verticals in them I assume you want to do the second, meaning you want to edit (what i assume is a road and a stream layer) either the street or road layer? And you mentioned 'Verticals' does that mean you want to change the elevation (Y) of a 3D line feature class at the point of intersection?
... View more
09-19-2022
07:40 AM
|
0
|
1
|
1097
|
|
POST
|
I agree with Charlie, it appears that the Esri_Button style sets the MinWidth to 70. So out-of-box the following XAML results in this UI representation: XAML: <Button Grid.Column="1" HorizontalAlignment="Left"
Style="{DynamicResource Esri_Button}" Command="{Binding OpenProjectCmd}" >
<Image Source="Images\ArcGISProjectOpen16.png" Width="16" Height="16" />
</Button> If you set the following Button tag attributes: 'MinWidth', 'MinHeight' and 'Padding' the Button's inner elements will determine the width/height: <Button Grid.Column="1" HorizontalAlignment="Left" MinWidth="0" MinHeight="0" Padding="0"
Style="{DynamicResource Esri_Button}" Command="{Binding OpenProjectCmd}" >
<Image Source="Images\ArcGISProjectOpen16.png" Width="16" Height="16" />
</Button> So now the UI looks like this: The reason why the Visual Studio XAML designer is not really WYSIWYG is because the XAML designer is not able to locate various Pro assemblies during design time, hence any ArcGIS Pro styles look different in the XAML designer versus when Pro is running.
... View more
09-16-2022
03:30 PM
|
1
|
1
|
2898
|
|
POST
|
To answer your question, it's important to know where SelectedOriginFeature.Feature is coming from. There are multiple causes that can lead to this exception: Features can contain null or empty geometries, empty envelopes, and may optionally include geometries that are not simple this could lead to this error. Also, it depends on how you populate your datagrid and then populate the 'Feature' property. If you use a FeatureCursor as a returned by the Search method for example, you have to make sure that the cursor is not recycling. The default for recycling is True, which can lead to this problem. Search Method (Table)—ArcGIS Pro. Having populated datagrids in the past i usually populate a custom class for each feature (added to an ObservableCollection) where i store the attribute data that i like to display. If i have need for the geometry i use the Geometry's Clone method (when iterating through the cursor) to keep a copy of the geometry for later use. This way i don't have to worry about recycling cursors etc. Another way to avoid this problem is to retrieve the geometry only once you select a feature row using the object id (or global id). Here is a sample that is doing just that: Esri/arcgis-pro-sdk-community-samples: ArcGIS Pro SDK for Microsoft .NET Framework Community Samples (github.com)
... View more
09-16-2022
11:00 AM
|
1
|
2
|
1850
|
|
POST
|
For the API Reference help you can just replace the '/latest/' in the help URL with the version you're working with for example: https://pro.arcgis.com/en/pro-app/2.9/sdk/api-reference/index.html#topic1.html Examples snippets are available by cloning this repository: Esri/arcgis-pro-sdk: ArcGIS Pro SDK for Microsoft .NET is the new .NET SDK for the ArcGIS Pro Application. (github.com) Unfortunately the wiki with ProConcepts, ProSnippets and ProGuides is not versioned. Correction: you can clone the wiki as well, but you have to read the md pages using a browser. The viewing experience is not very good.
... View more
09-15-2022
02:36 PM
|
0
|
0
|
1951
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-07-2025 07:27 AM | |
| 2 | 3 weeks ago | |
| 1 | 07-30-2025 12:03 PM | |
| 1 | 10-06-2025 01:19 PM | |
| 1 | 10-06-2025 10:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|