其他分享
首页 > 其他分享> > ArcGIS Pro创建要素后自动更新字段值

ArcGIS Pro创建要素后自动更新字段值

作者:互联网

{
 var mapProjItem = Project.Current.GetItems<MapProjectItem>().FirstOrDefault(item => item.Name.Contains("Map"));
 if (mapProjItem == null)
   return;

            QueuedTask.Run(() =>
            {
                var theMap = mapProjItem.GetMap();
                
                IEnumerable<FeatureLayer> featLayer = theMap.GetLayersAsFlattenedList().OfType<FeatureLayer>();
                foreach (FeatureLayer item in featLayer)
                { 
                   var layerTable = item.GetTable();
                   _rowCreateToken = RowCreatedEvent.Subscribe(onRowCreateEvent, layerTable);                        
             }

}

private void onRowCreateEvent(RowChangedEventArgs obj)
        {
            obj.Row["field"] = "Some Value";
 
}

 

标签:段值,Pro,onRowCreateEvent,item,自动更新,var,mapProjItem,theMap,layerTable
来源: https://www.cnblogs.com/gisoracle/p/16276299.html