arcpy.cartography.ConvertLabelsToAnnotation in script failing at Pro 2.9, works in 2.8

399
2
02-17-2022 11:43 AM
geckoberyl
New Contributor II

Hi there. Can anyone think of what is happening here or recommend troubleshooting steps?

I have a script that (among other things):

-overwrites a feature class from a SQL table
-converts labels on that feature to annotation in a GDB:

arcpy.cartography.ConvertLabelsToAnnotation(mCSM, 250, outGDBAnno, 'Anno', None, None, None, 'STANDARD', None, None, 'GroupAnnoVB', 'SINGLE_LAYER', 'VB', 'FEATURE_CLASS_PER_FEATURE_LAYER', 'NO_MERGE_LABEL_CLASS')

...this throws ERROR 000840: The value is not a Feature Layer when run at 2.9.

The feature class is valid and I can export annotations from with that code outside a script. But the command fails when run in the script. 

Has anything changed at 2.9 that would have any affect on this script?

Thanks!

Tags (2)
0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

when run as a script have you set your workspace somewhere ? for example, you only provide the gdb name not its workspace path


... sort of retired...
0 Kudos
geckoberyl
New Contributor II

Thanks for lightning quick response! Yes, the full path to the workplace and the path to the GDB are defined. the parts of the script that run properly use those items.

0 Kudos