|
POST
|
I've attempted grabbing data from MS Access 2003 to display in a Form within ArcGIS Pro, and cannot get it to work. In ArcMap 10.2, no problems. I'm not totally sure why, but I think it's an issue with 32 bit office and 64 bit ArcGIS. Once I upgraded Access to the latest version, Access 365, then things started to work again. I think VB6 support within esri software ended at ArcMap v9.
... View more
04-12-2019
10:27 AM
|
0
|
2
|
2276
|
|
POST
|
Hi, I'm using the following line of code to get the ConnectionString info on a FeatureClass. Usually there are no problems, but when I join a table to the layer, I get a "Data Store is invalid or not supported" error. Any ideas as to why this might be happening?? The joined table is a .xls spreadsheet.
... View more
04-12-2019
07:18 AM
|
0
|
8
|
2775
|
|
POST
|
Hi Sean Jones, Thanks for the tip on the 1.1 sample. That has definitely helped. I've now got it working so that it works for all layers in the opened project. As you said, I'll need to add some code for added/removed layers, new maps, etc. but I'm on the right path now. What I'm realizing is that I don't need to Subscribe to EVERY layer in every map. I only need to subscribe to the layers from a particular server, or even more specifically, those that are Versioned. Any tips on determining if the current FeatureLayer is versioned?? It doesn't appear to be in the FeatureClassDefinition. Where should I be looking for this?? Thanks!! using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.Threading.Tasks;
using ArcGIS.Core.CIM;
using ArcGIS.Core.Data;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Catalog;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Editing;
using ArcGIS.Desktop.Extensions;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;
using ArcGIS.Desktop.Framework.Dialogs;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;
using ArcGIS.Desktop.Editing.Events;
using ArcGIS.Desktop.Core.Events;
namespace RowChanged_TEST
{
internal class Module1 : Module
{
private static Module1 _this = null;
private bool fakeEdit = false;
/// <summary>
/// Retrieve the singleton instance to this module here
/// </summary>
public static Module1 Current
{
get
{
return _this ?? (_this = (Module1)FrameworkApplication.FindModule("RowChanged_TEST_Module"));
}
}
#region Overrides
/// <summary>
/// Called by Framework when ArcGIS Pro is closing
/// </summary>
/// <returns>False to prevent Pro from closing, otherwise True</returns>
protected override bool CanUnload()
{
//TODO - add your business logic
//return false to ~cancel~ Application close
return true;
}
protected override bool Initialize()
{
ProjectOpenedEvent.Subscribe(onProjectOpened);
//var eceToken = EditCompletedEvent.Subscribe(onEce);
return base.Initialize();
}
private void onProjectOpened(ProjectEventArgs args)
{
//Subscribe to the EditCompleted event....maybe I don't need this??
EditCompletedEvent.Subscribe(onEce);
//1. Loop to go through each Map in the project
//2. Loop to go through each layer in each Map
//Need to edit this so only ones we need are accounted for!!
QueuedTask.Run(() =>
{
foreach (MapProjectItem mapItem in Project.Current.GetItems<MapProjectItem>())
{
var theMap = mapItem.GetMap();
foreach (FeatureLayer fLayer in theMap.GetLayersAsFlattenedList().OfType<FeatureLayer>())
{
var layerTable = fLayer.GetTable();
var rowChangedToken = RowChangedEvent.Subscribe(OnRowChanged, layerTable);
}
}
});
}
protected Task onEce(EditCompletedEventArgs args)
{
return Task.FromResult(0);
}
private Guid _currentRowChangedGuid = Guid.Empty;
protected void OnRowChanged(RowChangedEventArgs args)
{
var row = args.Row;
if (_currentRowChangedGuid == args.Guid)
return;
row["LASTUSER"] = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
row["DATEMODIFIED"] = DateTime.Now.ToString();
//_currentRowChangedGuid = args.Guid;
//row.Store();
_currentRowChangedGuid = Guid.Empty;
}
#endregion Overrides
}
}
... View more
04-11-2019
09:11 AM
|
0
|
1
|
1733
|
|
POST
|
And in my Config.daml I have autoload="True" because I always want this tool to be running in the background. I always want it to be tracking user edits, and not just when the user turns in 'On'.
... View more
04-10-2019
07:58 AM
|
0
|
3
|
5377
|
|
POST
|
Hi Sean Jones, When I do this in the Initialize, I get an error even before the .aprx file loads into ArcGIS with a NullReference Exception on the var featLayer initialization. I guess the Module is loading before the map? protected override bool Initialize()
{
var featLayer = MapView.Active.Map.GetLayersAsFlattenedList().FirstOrDefault() as FeatureLayer;
var layerTable = featLayer.GetTable();
//subscribe to row events
var rowChangeToken = RowChangedEvent.Subscribe(OnRowChanged, layerTable);
return true;
}
When I do it this way, things seem to work, but only after the first edit. protected override bool Initialize()
{
var eceToken = EditCompletedEvent.Subscribe(onEce);
return true;
}
protected Task onEce(EditCompletedEventArgs args)
{
QueuedTask.Run(() =>
{
var featLayer = MapView.Active.Map.GetLayersAsFlattenedList().FirstOrDefault() as FeatureLayer;
var layerTable = featLayer.GetTable();
//subscribe to row events
var rowChangeToken = RowChangedEvent.Subscribe(OnRowChanged, layerTable);
//}
});
return Task.FromResult(0);
}
... View more
04-10-2019
05:07 AM
|
0
|
4
|
5377
|
|
POST
|
Hi Sean Jones, Things are working pretty good now. I've moved the code into a new ArcGIS Pro Module Add-In, just to narrow down where things were going wrong. In my Module1.cs I have the following: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.Threading.Tasks;
using ArcGIS.Core.CIM;
using ArcGIS.Core.Data;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Catalog;
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Editing;
using ArcGIS.Desktop.Extensions;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;
using ArcGIS.Desktop.Framework.Dialogs;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;
using ArcGIS.Desktop.Editing.Events;
namespace RowChanged_TEST
{
internal class Module1 : Module
{
private static Module1 _this = null;
/// <summary>
/// Retrieve the singleton instance to this module here
/// </summary>
public static Module1 Current
{
get
{
return _this ?? (_this = (Module1)FrameworkApplication.FindModule("RowChanged_TEST_Module"));
}
}
#region Overrides
/// <summary>
/// Called by Framework when ArcGIS Pro is closing
/// </summary>
/// <returns>False to prevent Pro from closing, otherwise True</returns>
protected override bool CanUnload()
{
//TODO - add your business logic
//return false to ~cancel~ Application close
return true;
}
protected override bool Initialize()
{
//ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("HI");
var eceToken = EditCompletedEvent.Subscribe(onEce);
return true;
}
protected Task onEce(EditCompletedEventArgs args)
{
QueuedTask.Run(() =>
{
//Listen for row events on a layer
var featLayer = MapView.Active.GetSelectedLayers().First() as FeatureLayer;
var layerTable = featLayer.GetTable();
//subscribe to row events
var rowChangeToken = RowChangedEvent.Subscribe(OnRowChanged, layerTable);
});
return Task.FromResult(0);
}
private Guid _currentRowChangedGuid = Guid.Empty;
protected void OnRowChanged(RowChangedEventArgs args)
{
var row = args.Row;
if (_currentRowChangedGuid == args.Guid)
return;
row["COMMENTS"] = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
row["CONDITION"] = DateTime.Now.ToString();
//_currentRowChangedGuid = args.Guid;
//row.Store();
_currentRowChangedGuid = Guid.Empty;
}
#endregion Overrides
} It's all working well. One issue I am having is getting past this line: var featLayer = MapView.Active.GetSelectedLayers().First() as FeatureLayer; Unless I have a layer selected in the Table of Contents, I get an error....as expected I suppose. This was just a copy/paste from the API Reference Guide, so I'll have to refine it a bit. I guess I should be getting the layers edited through the EditCompletedEventArgs?? Another issue, is that whenever I run the code it never works the first time. For example, I'll make some edits (with a layer in the TOC selected), the code runs, but doesn't do anything....no errors....it just doesn't work. Then I immediatley do another edit, and everything works as expected. I'm not really sure what might be going on, but I've created a few other tools where I have seen this behaviour before. Do you see anything in my code that might be causing this? Have you ever heard of network or back-end DB configuration that might be causing this problem?? Thanks for your help!
... View more
04-09-2019
12:08 PM
|
0
|
6
|
5377
|
|
POST
|
OK, so I've done some more research on this. Still not sure if I'm on the right track, but things are working more predictably now. As per some articles and the ArcGIS Pro Reference guide, I am now looking at subscribing to the EditCompletedEvent. This is what I have so far which seems to be working for both attribute edits and geometry changes. (Still need to look into creating new features) protected override bool Initialize()
{
//ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("HI");
var eceToken = EditCompletedEvent.Subscribe(onEce);
return true;
}
protected Task onEce(EditCompletedEventArgs args)
{
IReadOnlyCollection<MapMember> members = args.Members;
foreach (MapMember member in members)
{
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(member.Name.ToString());
}
return Task.FromResult(0);
} So I am getting a messagebox with the name of the layer I am editing, which is what I am expecting. But....Is there a way to get at the features that were actually edited? Not just the ones that are selected, but the ones that were actually edited. So even if 10 are selected, but only 1 was edited, I am just interested in the 1 that was edited.
... View more
04-09-2019
08:16 AM
|
0
|
8
|
5377
|
|
POST
|
Hi Sean Jones, Thanks. For what I am trying to do I need to be listening to all edits as they happen; RowCreated, RowChanged and RowDeleted. Not to any one specific layer, but any layer pulled in from SDE. Basically I am trying to create a custom 'Editor Tracking' as we will be turning it off on the DB side to accomodate some requirements of another application that needs to monitor the GIS data. Currently I am trying to listen for just the RowChanged event from the Toolbar, but no such luck. Here is my code that I have placed in the Toolbars module1.cs. The problem is that it doesn't seem to be catching any of my edits. using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using ArcGIS.Desktop.Framework;
using ArcGIS.Desktop.Framework.Contracts;
using System.Threading.Tasks;
using ArcGIS.Desktop.Editing;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Desktop.Mapping;
using ArcGIS.Desktop.Editing.Events;
namespace DSM_Toolbar_ArcPro
{
internal class Module1 : Module
{
private static Module1 _this = null;
/// <summary>
/// Retrieve the singleton instance to this module here
/// </summary>
public static Module1 Current
{
get
{
return _this ?? (_this = (Module1)FrameworkApplication.FindModule("DSM_Toolbar_ArcPro_Module"));
}
}
#region Overrides
/// <summary>
/// Called by Framework when ArcGIS Pro is closing
/// </summary>
/// <returns>False to prevent Pro from closing, otherwise True</returns>
protected override bool CanUnload()
{
//TODO - add your business logic
//return false to ~cancel~ Application close
return true;
}
protected override bool Initialize()
{
QueuedTask.Run(() =>
{
//Listen for row events on a layer
var featLayer = MapView.Active.GetSelectedLayers().First() as FeatureLayer;
var layerTable = featLayer.GetTable();
//subscribe to row events
//var rowCreateToken = RowCreatedEvent.Subscribe(OnRowCreated, layerTable);
var rowChangeToken = RowChangedEvent.Subscribe(OnRowChanged, layerTable);
//var rowDeleteToken = RowDeletedEvent.Subscribe(OnRowDeleted, layerTable);
});
return base.Initialize();
}
private Guid _currentRowChangedGuid = Guid.Empty;
protected void OnRowChanged(RowChangedEventArgs args)
{
var row = args.Row;
if (_currentRowChangedGuid == args.Guid)
return;
row["COMMENTS"] = "EDITED";
_currentRowChangedGuid = args.Guid;
row.Store();
_currentRowChangedGuid = Guid.Empty;
}
#endregion Overrides
}
}
... View more
04-09-2019
05:22 AM
|
0
|
9
|
5377
|
|
POST
|
Hi, I'm trying to implement some code in an AddIn that will listen for Edit events, and then run some code. I'm using the following article to help (https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic9808.html) but I'm not sure where I am supposed to put this code. Should I be creating a new AddIn for this, or can I just add the code to an existing AddIn? All users currently load the same Toolbar, which I have created an AddIn for. Can I just put the code in there?? Thanks,
... View more
04-08-2019
11:33 AM
|
1
|
14
|
7742
|
|
POST
|
Hi Kory, What options do we have then if we want to run a mixed environment? With ArcMap we used to use a Feature Class extension to track edits on the fly. Is there such an option with ArcGIS Pro so we wouldn't have to use the Attribute Rules? We are in a situation where we need to disable Editor Tracking on the database, so need a way to replace that as well as enforce some edit/create rules on the data. See this thread for details: https://community.esri.com/thread/231699-disabling-editor-tracking-options
... View more
04-05-2019
11:32 AM
|
0
|
0
|
2013
|
|
POST
|
Hi, So with ArcMap we are using Attribute Assistant. If we configure Attribute Rules for users that are using ArcGIS Pro, will that cause issues with ArcMap users using the Assistant?? Or in a mixed desktop environment, can you only have one or the other?? Thanks,
... View more
04-05-2019
10:24 AM
|
0
|
4
|
2259
|
|
POST
|
Hi, We are trying to integrate an Enterprise Asset Management System (EAMS) into our existing esri SDE environment. We need to add some fields to our data so the EAMS can determine what features to upload/edit in it's own database on a nightly basis. These fields are edited by the EAMS as it copies data from SDE. We currently have editor tracking turned on on the DB, but will need to turn this feature off so that the EAMS doesn't mess with our editor tracking. What are the best options for keeping editor tracking going forward? Our current thoughts are: 1. Customize the existing editor tracking to ignore the EAMS during it's nightly process (is this even possible??) 2. Create a custom Feature Class extension to essentially mimic editor tracking. We used to do this until Editor Tracking became available on the back end. Is it still possible to do this? We would only want it to work for the regular users, and not for the EAMS system. We are at 10.4 right now. What other options are available? Upgrading the desktop to ArcPro is also on our radar, so ideally something that would work for both ArcMap and ArcPro would be ideal. Thanks,
... View more
04-05-2019
05:19 AM
|
0
|
0
|
925
|
|
POST
|
OK. Sounds good. The only thing I know about Dojo is that is where I take my kid there everyweek for karate lessons. I'll have to do some more reading on what this is and how to use. Arigato!!
... View more
04-01-2019
08:42 AM
|
0
|
0
|
458
|
|
POST
|
Yes....everything works fine up to that point. It's when I try to run the jQuery stuff after the showContractNumber function, that I run into problems. I'm just trying to run some sample code I found on the web to make sure I am doing things in the right spot. Eventually I will replace that with the 'real' code. Can I run jQuery code from the widget.js file? Or should I be putting it somewhere else?? This is the error I get from the Console window in Chrome:
... View more
04-01-2019
07:55 AM
|
0
|
2
|
4755
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-29-2026 07:40 AM | |
| 1 | 10-17-2023 07:40 AM | |
| 1 | 04-14-2026 08:54 AM | |
| 2 | 08-18-2023 08:57 AM | |
| 1 | 04-13-2018 10:07 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-29-2026
09:43 AM
|