POST
|
We have IGraphicsContainer on ArcObjects SDK and we use it for some temporary information storing. As I understand for the same purpose I could use map notes templates (for example Line note template). How can I add Line template layer to map I have some plans (using template id activate tool), but how to check which layer was added? By layer name or other properties? What will be if customer will change layer properties? I would like to add and delete features depending on my workflow.
... View more
06-04-2019
07:41 AM
|
0
|
2
|
501
|
POST
|
Hi John, If you do not use MVVM then you could add event to your xaml file like this: <ComboBox x:Name="cbLayer" Margin="10" Width="150" SelectionChanged="Layer_SelectionChanged"> In xaml.cs you need to add method for SelectionChanged: private void Layer_SelectionChanged(object sender, SelectionChangedEventArgs e) In MVVM you do not need OnSelectionChange. You need to create property for SelectedItem or SelectedValue in your model view file and make binding in xaml <ComboBox ItemsSource="{Binding Layers}" SelectedItem="{Binding SelectedLayer}"/>
... View more
06-03-2019
11:23 PM
|
1
|
1
|
934
|
POST
|
Hi, Sorry. I have combined code in notepad. Instead of featureClass you need to use firstLayer. I send you update peace of code: var firstLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); var selectionfromMap = firstLayer.GetSelection(); ArcGIS.Core.Data.QueryFilter filter = new ArcGIS.Core.Data.QueryFilter { ObjectIDs = selectionfromMap.GetObjectIDs() }; // get the row using (ArcGIS.Core.Data.RowCursor rowCursor = firstLayer.Search(filter)) { while (rowCursor.MoveNext()) { long oid = rowCursor.Current.GetObjectID(); // get the shape from the row ArcGIS.Core.Data.Feature feature = rowCursor.Current as ArcGIS.Core.Data.Feature; Polygon polygon = feature.GetShape() as Polygon; // do something here }
... View more
05-29-2019
11:48 PM
|
3
|
1
|
2029
|
POST
|
Hi Jaewon, This is code combined from few ArcGIS Pro snippets: var firstLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); var selectionfromMap = firstLayer.GetSelection(); ArcGIS.Core.Data.QueryFilter filter = new ArcGIS.Core.Data.QueryFilter { ObjectIDs= selectionfromMap.GetObjectIDs(); }; // get the row using (ArcGIS.Core.Data.RowCursor rowCursor = featureClass.Search(filter, false)) { while (rowCursor.MoveNext()) { long oid = rowCursor.Current.GetObjectID(); // get the shape from the row ArcGIS.Core.Data.Feature feature = rowCursor.Current as ArcGIS.Core.Data.Feature; Polygon polygon = feature.GetShape() as Polygon; // get the attribute from the row (assume it's a double field) double value = (double)rowCursor.Current.GetOriginalValue(fldIndex); // do something here } }
... View more
05-29-2019
11:24 PM
|
2
|
3
|
2029
|
POST
|
Hi Dylan, Sorry. I have replied from the mail and some part of my answer missed. I wanted to write what Dictionary is better than List in your case. For example if you need few fields from one layer, you can build dictionary like this: Dictionary<string, List<string>>, where first is layer name, second one is list of field names. So you will need less stuff to get the same results. I would code in different way case than one layer has few fields. I would read all values in one RowCursor. It will be faster. My GetAttributeValues procedure would have List<string> fieldNames parameter instead of string fieldName and return type will be List<string> for each of attribute fields. Then I don't need to check fields number, have 2 branches in my code and etc.
... View more
05-15-2019
10:43 PM
|
0
|
1
|
6413
|
POST
|
Hi Dharma, If you mean GeoProcessor using, then before calling Execute method you can set environment variables using SetEnvironmentValue method. Sample here: https://idea.isnew.info/how-to-use-the-geoprocessor-using-arcobjects.html
... View more
05-15-2019
02:34 AM
|
0
|
1
|
579
|
POST
|
Hi Dylan, At first instead of List kvp in features) { string fieldName; if(list.TryGetValue(kvp.Key.Name, out fieldName)) { long fCnt = kvp.Value.Count; total = total + fCnt; sb.AppendLine($@"{fCnt} {(fCnt == 1 ? "record" : "records")} selected for {kvp.Key.Name}"); QueryFilter queryFilter = new QueryFilter { ObjectIDs = kvp.Value }; using (RowCursor rowCursor = kvp.Key.Search(queryFilter)) { while (rowCursor.MoveNext()) { using (Row row = rowCursor.Current) { string attributeValue = Convert.ToString(row[fieldName]); // Do something with attribute value } } } } }
... View more
05-15-2019
02:16 AM
|
1
|
1
|
6413
|
POST
|
Hi Nirbhay, Look at the content of link: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Configurations
... View more
05-14-2019
06:28 AM
|
0
|
0
|
223
|
POST
|
Hi Khamille, Try to look at this link: https://community.esri.com/thread/210462-programmatically-start-the-edit-annotation-tool-in-modify-features
... View more
05-13-2019
10:42 PM
|
0
|
0
|
652
|
POST
|
Hi Tim, You can use Inspector (for one by one feature) // for each feature foreach (var oid in featOids) { // load the inspector with the feature var insp = new Inspector(); insp.Load(faetLayer, oid); .... } or use query like this: QueryFilter queryFilter = new QueryFilter { ObjectIDs = oids }; using (RowCursor rowCursor = featLayer.Search(queryFilter)) { while (rowCursor.MoveNext()) { using (Row row = rowCursor.Current) { Feature feat = row as Feature; .... } } }
... View more
05-12-2019
10:54 PM
|
3
|
0
|
6413
|
POST
|
Hi Brian, I use Execute for custom Commands and CurrentTool method from IApplication for custom Tools. They work a little bit different.
... View more
05-09-2019
06:54 AM
|
0
|
3
|
374
|
POST
|
Hi Dharma, “C:\Program Files\Common Files\ArcGIS\bin\ESRIRegAsm.exe” “.dll” /p:desktop
... View more
05-08-2019
02:48 AM
|
2
|
0
|
563
|
POST
|
HI Dharma, Have you registered for ArcMap your library with dockable window on another machine? Compiler registers your library on your machine automatically.
... View more
05-06-2019
11:45 PM
|
0
|
2
|
563
|
POST
|
Hi Mark, We use IGdbXmlImport and IGdbXmlExport for schema importing/exporting. But we work with personal or file geodatabases. I have not tried to use them on enterprise database. It could be some problems if your database contains Schematic stuff. http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#Export_datasets_to_an_xml_workspace_document_2.htm
... View more
05-06-2019
01:39 AM
|
1
|
1
|
1600
|
Title | Kudos | Posted |
---|---|---|
1 | 11-17-2023 02:12 AM | |
1 | 2 weeks ago | |
1 | 3 weeks ago | |
1 | a month ago | |
1 | a month ago |
Online Status |
Offline
|
Date Last Visited |
Tuesday
|