POST
|
Ha, looks like I didn't see the examples too closely. I just needed to add GeometryDimension.esriGeometry0Dimension and it fixed! var IntersectingGeometryPoints = GeometryEngine.Instance.Intersection(featureXS.GetShape(), feature.GetShape(), GeometryDimension.esriGeometry0Dimension) as Multipoint;
... View more
09-18-2019
06:54 AM
|
0
|
1
|
689
|
POST
|
Hello, Attached is a photo of my code, with the exception that it is having. Essentially I have two lines. One line going through many, many smaller lines (thousands). Some of the smaller lines I want to label. So the first step in finding these lines is finding a character code, which I do and find them easily. The second step is to get the intersecting point between the smaller line and the larger line. I follow the examples and first I need to check if they intersect, so they do. Then I try to get an IntersectingPoint and bam - it's null. What am I doing wrong? bool intersects = GeometryEngine.Instance.Intersects(featureXS.GetShape(), feature.GetShape()); // intersects = true if (intersects == true) { var IntersectingGeometryPoints = GeometryEngine.Instance.Intersection(featureXS.GetShape(), feature.GetShape()) as Multipoint; MapPoint intPoint = IntersectingGeometryPoints.Points[0]; Polyline needOriginPointFromGeom = featureXS.GetShape() as Polyline; for(int i = 0; i < needOriginPointFromGeom.PointCount; i++) { if(needOriginPointFromGeom.Points == intPoint) { xsPoints.Add(new XsPoint((int)featureXS.GetObjectID(), cursorXSRow.FindField("XS_LETTER"), intPoint, needOriginPointFromGeom.Points[i-1])); } } }
... View more
09-18-2019
06:49 AM
|
0
|
2
|
747
|
POST
|
Thanks for taking the time to answer. My solution ended up being ArcGIS.Core.Data.SortDescription refMileFieldSortDescription = new ArcGIS.Core.Data.SortDescription(refMileActualField); refMileFieldSortDescription.SortOrder = ArcGIS.Core.Data.SortOrder.Ascending; TableSortDescription tableSortDescription = new TableSortDescription(new List<ArcGIS.Core.Data.SortDescription>() { refMileFieldSortDescription } ); tableSortDescription.QueryFilter = profileScenarioFilter2; Table tableSortTable = profileScenarioTable.GetTable(); RowCursor sortedScenarioCursor = tableSortTable.Sort(tableSortDescription); you can put a Query filter in the TableSortDescription, which merged the two into being kind of a sort query command.
... View more
08-30-2019
06:57 AM
|
0
|
0
|
959
|
POST
|
Thanks I transmuted my code to this.... ArcGIS.Core.Data.SortDescription refMileFieldSortDescription = new ArcGIS.Core.Data.SortDescription(refMileActualField); refMileFieldSortDescription.SortOrder = ArcGIS.Core.Data.SortOrder.Ascending; TableSortDescription tableSortDescription = new TableSortDescription(new List<ArcGIS.Core.Data.SortDescription>() { refMileFieldSortDescription } ); Table tableSortTable = profileScenarioTable.GetTable(); RowCursor sortedScenarioCursorFromSort = tableSortTable.Sort(tableSortDescription); RowCursor sortedScenarioCursor = tableSortTable.Search(profileScenarioFilter2, false); But now I have a new question. How can I make sure I sort, and run my Query Filter at the same time? They both return RowCursors, but how can I merge Sorting and Searching to give me the correct rowcursor after sorting, then searching. Thank you.
... View more
08-29-2019
02:09 PM
|
0
|
2
|
959
|
POST
|
I have a question on how to implement a TableSort in ArcGISPro SDK In ArcObjects, the ArcMap SDK, you can do something like this TableSort tableSort = new ESRI.ArcGIS.Geodatabase.TableSortClass(); tableSort.Fields = refMileField; tableSort.set_Ascending(refMileField, true); tableSort.QueryFilter = profileScenarioFilter2; tableSort.Table = profileScenarioTable.Table; tableSort.Sort(null); Later on I use this TableSort in order to give a RowCursor its rows it needs. What is the proper way I can convert TableSort to a RowCursor? Or is there another way I need to convert the TableSort to another type? Thank You
... View more
08-29-2019
12:06 PM
|
0
|
6
|
1109
|
POST
|
Is there a way to do this? Perhaps there is an interface that lets me use the arcpy from arcgis pro sdk?
... View more
08-19-2019
07:05 AM
|
0
|
1
|
618
|
POST
|
How can I use dissolve with ArcGIS Pro SDK? My old code in ArcObjects was ExecuteGeoprocessingTool(new ESRI.ArcGIS.DataManagementTools.Dissolve() { in_features = intermediate, dissolve_field = "Name", out_feature_class = modelExtent }, false); Is there something similar in ArcGIS Pro SDK I can do?
... View more
08-16-2019
07:50 AM
|
0
|
2
|
735
|
POST
|
I found the answer await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { var fGdbPath = file.DirectoryName; var fGdbName = file.Name; var fGdbVersion = "Current"; // create the 'latest' version of file Geodatabase System.Diagnostics.Debug.WriteLine($@"create {fGdbPath} {fGdbName}"); var parameters = Geoprocessing.MakeValueArray (fGdbPath, fGdbName, fGdbVersion); var cts = new System.Threading.CancellationTokenSource(); var results = Geoprocessing.ExecuteToolAsync("management.CreateFileGDB", parameters, null, cts.Token, (eventName, o) => { System.Diagnostics.Debug.WriteLine($@"GP event: {eventName}"); }); return true; });
... View more
07-26-2019
07:12 AM
|
3
|
0
|
1977
|
POST
|
Hello, I have read https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase It looks like there is not snippet to create a GeoDatabase unless it automatically does it if it doesn't exist. My code is Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(dbPath))); This is for opening an existing database, but if dbPath does not exist then how should I approach creating a brand new GeoDatabase? I have the DirectoryName and the File Name of the geodatabase, so how do I create that? Thank you!
... View more
07-25-2019
10:19 AM
|
0
|
3
|
2285
|
POST
|
Thanks for the advice, I'll change that so it just does it in one EditOperation.
... View more
07-23-2019
01:01 PM
|
0
|
0
|
1042
|
POST
|
Hi Rich, Thanks for that. I am now using the code var modifyOp = new ArcGIS.Desktop.Editing.EditOperation();
modifyOp.Name = "Update Fields";
modifyOp.Modify(row, measField, xSecLocate.Meas);
//modifyOp.Modify(row, refMileField, xSecLocate.Meas);
modifyOp.Execute(); However it appears to be going very slow. I have a table of roughly 600,000 points. Updating each row is quite long. Is there a way to increase the speed of it? Or is there a more optimized approach to doing this?
... View more
07-15-2019
12:23 PM
|
0
|
1
|
1042
|
POST
|
I would like to know how I can update a value in a table. Here is my first go from looking at all the examples. RowCursor cursor = profilesByStation.Search(null, false);
string nameoftable = profilesByStation.GetName();
int riverField = cursor.FindField(General.MMCProperties.Instance.getPropertyAsString("FieldsProfileRiverCode"));
int reachField = cursor.FindField(General.MMCProperties.Instance.getPropertyAsString("FieldsProfileReachCode"));
int stationField = cursor.FindField(General.MMCProperties.Instance.getPropertyAsString("FieldsProfileStation"));
int measField = cursor.FindField(General.MMCProperties.Instance.getPropertyAsString("FieldsProfileRef"));
string refMileField = General.MMCProperties.Instance.getPropertyAsString("FieldsXsRefMile");
if (riverField == -1 || reachField == -1 || stationField == -1 || measField == -1) {
System.Windows.Forms.MessageBox.Show("An error was encountered when trying to update the refmile data. The river field, reach field, station field, or measField was not found.\r\n");
return;
}
while (cursor.MoveNext()) {
Row row = cursor.Current;
object river = row[riverField];
object reach = row[reachField];
object station = row[stationField];
if (!(river is System.DBNull || reach is System.DBNull || station is System.DBNull)) {
Models.XSecLocate xSecLocate = Models.XSecLocate.findXSecLocate(xSecLocateList,Convert.ToString(river),Convert.ToString(reach),Convert.ToDouble(station),true);
if (xSecLocate != null) {
row[measField] = xSecLocate.Meas;
row[refMileField] = xSecLocate.Meas;
}
}
} As you can see I am updating the row/column field value by row[refMileField] = xSecLocate.Meas; However when I do this, it doesn't appear that anything in my table was updated.
... View more
07-12-2019
10:17 AM
|
0
|
4
|
1344
|
POST
|
Hi, Is there anyone I can call at ESRI for this issue?
... View more
06-26-2019
07:25 AM
|
0
|
0
|
459
|
POST
|
My project has compiled successfully, and during debug I can get it to load my project and map. However when I activate a button on my toolbar, it goes into breakmode when I try to activate it and gives me the errors in the output. 'ArcGISPro.exe' (CLR v4.0.30319: ArcGISPro.exe): Loaded 'C:\Users\[user]\AppData\Local\ESRI\ArcGISPro\AssemblyCache\{43adde3c-aa81-4fe3-adbc-a8bc1ab90be7}\MyAddin.dll'. Symbols loaded. An unhandled exception of type 'System.IO.FileNotFoundException' occurred in ArcGIS.Desktop.Framework.dll Could not load file or assembly 'MyAddin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. The main error I see is An unhandled exception of type 'System.IO.FileNotFoundException' occurred in ArcGIS.Desktop.Framework.dll What would be causing this? I need access to the framework I believe, is there something wrong with how I am calling that? I've attached the reference properties. Does anyone have any ideas? When I click continue execution the program crashes.
... View more
06-24-2019
09:43 AM
|
0
|
1
|
541
|
Title | Kudos | Posted |
---|---|---|
1 | 08-30-2019 06:55 AM | |
3 | 07-26-2019 07:12 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|