POST
|
Awesome, thank you. I landed on something similar and am now wondering, in which situations is it better to use one over the other? MapView.Active.Map.GetLayersAsFlattenedList().OfType<GroupLayer>().ToList(); VS IReadOnlyList<GroupLayer> groupLayers = MapView.Active.Map.Layers.OfType<GroupLayer>().ToList(); Thanks!
... View more
10-10-2018
07:34 AM
|
0
|
3
|
1286
|
POST
|
Thanks for the reply. It appears I was using it incorrectly! Once I used the ToList() I was able to get them all! Thank you.
... View more
10-10-2018
07:23 AM
|
0
|
0
|
1286
|
POST
|
Hello. I am trying to mimic something I have setup in Arc10.6 - ArcObjects to ArcPro 2.2 - ArcPro SDK and am having a hard time finding what I am looking for. Basically, I am trying to change the visibility of different group layers in the TOC. With ArcObjects I was able to use ICompositeLayer to easily get into the various group layers. Now... I'm sort of at a loss. I tried MapView.Active.Map.Layers AND MapView.Active.Map.GetLayersAsFlattenedList().OfType<GroupLayer>() Just not sure I'm using it correctly as it only gets me to the first level of grouplayers. Maybe I can just use the GroupLayer class? The common structure of my group layers are - Group A > Group B > Group C > FeatureLayer. Any tips or documentation for setting the visibility of a group layer would be greatly appreciated!
... View more
10-05-2018
09:17 AM
|
0
|
7
|
1529
|
POST
|
Any reason this wouldn't work with ItemAdded/ItemRemoved? private static IActiveViewEvents_Event Events
{
get { return ArcMap.Document.ActiveView as IActiveViewEvents_Event; }
}
void Event_OnOpenDoc()
{
ArcMap.Events.OpenDocument += delegate() { Events.ItemAdded += Events_ItemAdded; };
}
private void Events_ItemAdded(Object item)
{
MessageBox.Show("ItemAdded");
} I am able to run this without error but nothing happens when an item is added to the view. I feel like I'm missing something or using this incorrectly. Any help with this is greatly appreciated!
... View more
04-07-2016
01:50 PM
|
0
|
0
|
314
|
POST
|
This was the issue. We use annotation layers and sure enough there is a relationshipclass on the file it errored on. Thank you, and everyone else for the great help on this.
... View more
04-10-2015
07:36 AM
|
1
|
0
|
392
|
POST
|
Is there a way to tell if there is a relationship class attached to it?
... View more
04-10-2015
05:50 AM
|
0
|
2
|
392
|
POST
|
That's why I am wondering if there is something strange with creating a FGDB with one license level and then trying to alter it with another. I'll take a look at the matrix but it seems really wrong that I wouldn't be able to do something basic like add a field. Regardless of which license level I was using. Thanks for the info(I also didn't mean to mark my post as helpful, sorry).
... View more
04-09-2015
03:20 PM
|
1
|
5
|
661
|
POST
|
It's not an SDE GDB... That's why I thought it was strange. But i tested it with the Standard license and there was no issue.
... View more
04-09-2015
03:16 PM
|
0
|
0
|
661
|
POST
|
it's just an addField on a featureclass table in a GDB.
... View more
04-09-2015
02:59 PM
|
0
|
2
|
661
|
POST
|
It is concurrent and usually tied up during the day for testing but could work overnight. Do you know if I alter the tables with the Standard will it make it so the rest of my data then will need a standard license to be altered in the future?
... View more
04-09-2015
02:58 PM
|
1
|
7
|
661
|
POST
|
I am going through and adding fields to featureclasses when I came across this error. We have 2 licenses (Standard/Basic) and on the basic level I get the error and on the Standard level it runs just fine. I am wondering if there is any way around this without upgrading or having to switch licenses just to run my script. I am also worried that by running this with the standard license that I will not be able to ever run it with the basic. I understand the obvious answer is to upgrade but I thought I would see what some other options are. ExecuteError: ERROR 999999: Error executing function. The application is not licensed to create or modify schema for this type of data Failed to execute (AddField). Thanks! Chris
... View more
04-09-2015
01:26 PM
|
0
|
16
|
5104
|
POST
|
I guess I will look into using the arcpy.da.updateCursor... Thank you Ian and Blake for the help! Best Chris
... View more
03-30-2015
10:53 AM
|
0
|
1
|
2396
|
POST
|
That did indeed get me through the loop (sometimes it's the most obvious stuff)! But it does not update the field when I add: cur.updateRow(row) Thoughts?
... View more
03-30-2015
10:03 AM
|
0
|
0
|
2396
|
POST
|
Thank you for the reply, I will have a look at your suggestions. I will give it a go with calc field though. Thanks! For my addFields I am using a tuple with no issues. add_Fields = [("New_NAME","TEXT","","","254","","NULLABLE","NON_REQUIRED","")]
arcpy.AddField_management(*(os.path.join(dirpath, filename),) + field) I am running into problems when I try to update the new field with the old value. #create field search list
possibleSearchFields = ["ENG_NAME"]
updateField = ["SL_NAME"]
searchFields = []
#Loop through possibleSearchFields
for psf in possibleSearchFields:
if psf in [f.name for f in fieldList]:
#add to searchFields
searchFields.append(psf)
#LOOP ROWS
cur = arcpy.UpdateCursor(os.path.join(dirpath, filename))
for row in cur:
for searchField in searchFields:
#if value of field not blank, set updateField's value in row. also exit out of row loop
if row.getValue(updateField[0]) == None:
print searchField + "exists in the table and is updating: " + filename
row.setValue(updateField[0], row.getValue(searchField))
cur.updateRow(row)
print "Updated row: " + str(row) + " in " + filename
else:
print " No name field in the search list: " + filename
... View more
03-30-2015
09:58 AM
|
0
|
4
|
2396
|
Title | Kudos | Posted |
---|---|---|
1 | 04-09-2015 02:58 PM | |
1 | 04-09-2015 03:20 PM | |
1 | 04-10-2015 07:36 AM |
Online Status |
Offline
|
Date Last Visited |
11-29-2021
12:15 PM
|