Select to view content in your preferred language

Accessing Data Frame unique layer ID's using Arcpy

5099
5
06-08-2016 04:14 PM
RonnieRichards
Frequent Contributor

In ArcMap 10.3 the option to assign unique layer ID's was enabled. When enabled this allows map authors to set the numeric ID's accordingly.

2016-06-08_16-07-20.jpg

 

Can this data frame property be read in Arcpy to determine if an MXD is using this setting?

Can arcpy access the layer ID thru the layer object?

 

Thanks for any info

Ronnie

0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

scroll way down Layer—Help | ArcGIS for Desktop

I think it is there under service properties

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Regarding your first question, it appears the answer is no.  Reviewing the ArcPy Mapping module DataFrame documentation, it doesn't appear the property you are looking for is made available through ArcPy.  This isn't the only Data Frame property not available through ArcPy.  Although I haven't done it myself, I am sure you could use comTypes or some other Python COM package to access ArcObjects through Python and retrieve the setting.

Regarding your second question, I don't believe so either.  Although a map service layer in ArcMap can have its Service Properties retrieved, the properties listed in the Layer ​documentation don't appear to cover a publishing unique ID.  Beyond that, what you are after seems to be information about/for publishing layer(s) as map services, not consuming map services as layers.  If that is the case, Service Properties might not even be supported for the layers you are working with.

RonnieRichards
Frequent Contributor

Thank you Joshua! I was hoping to be able to access the unique IDs assigned to layers in the MXD when reading the MXD using Arcpy. It appears this property is missing from the Arcpy.mapping module and will likely submit an idea for this one.

0 Kudos
SzymonPiskula1
Regular Contributor

Hi,

Has anyone found solution for this? I am working on automated map service publishing scripts and i would like to run checks on MXD to enforce the option being switched on by users before publishing.

TomasPokorny
Regular Contributor

also looking for reply, at least in 10.6.1 versions...

0 Kudos