Roger,I just tried the following code on a river network I have and it did not produce an error.# Layer name in Map Document s = "Rivers" # Describe object and print name string to confirm it worked desc = arcpy.Describe(s) print desc.namestring # Get spatial reference and print name sr = desc.spatialreference print sr.name # Get FeatureClass and check if M aware fc = desc.featureclass print fc.hasm # Set M domain sr.setmdomain( -1000,1000) This would suggest that there is something odd with your layer as your code looks sound?Duncan
# Layer name in Map Document s = "Rivers" # Describe object and print name string to confirm it worked desc = arcpy.Describe(s) print desc.namestring # Get spatial reference and print name sr = desc.spatialreference print sr.name # Get FeatureClass and check if M aware fc = desc.featureclass print fc.hasm # Set M domain sr.setmdomain( -1000,1000)
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.