Numéro d’ID de bogue |
BUG-000105415 |
Envoi | May 26, 2017 |
Dernière modification | June 5, 2024 |
S’applique à | ArcGIS Pro |
Version trouvée | 1.4 |
Système d’exploitation | Windows OS |
Version du système d’exploitation | 7 |
Statut | Known Limit
Après examen par l’équipe de développement, il a été déterminé que ce problème est lié à une limitation connue du logiciel sur laquelle Esri n’a aucun contrôle. Pour d’autres explications, reportez-vous à la section Informations supplémentaires correspondant au problème.
|
Informations supplémentaires
for lyr in m.listLayers (): #get layer object
if lyr.name == inLyr:
arcpy.AddMessage ("found lyr in map")
inLyrPath = os.path.dirname (lyr.dataSource)
outLyr = os.path.join (inLyrPath, outLyrName)
arcpy.AddMessage ("full path to outLyr: " + outLyr)
arcpy.CopyFeatures_management (inLyr, outLyr)
arcpy.AddMessage ("after CopyFeatures")
arcpy.SetParameterAsText (2, outLyr) #push layer out to map
arcpy.AddMessage ("after SetParameterAsText")
break;
p = arcpy.mp.ArcGISProject ("CURRENT") #get current project
m = p.listMaps () [0] #get first map in project
m.addDataFromPath(outLyr)
for lyr in m.listLayers ():
arcpy.AddMessage ("lyr.name: " + lyr.name)
Solution de contournement
Perform any task requiring access to the new layer before exiting the loop where the layer object is current.
For instance, use the MakeFeatureLayer to create a layer object and return that object to the map instead of returning the new layer 'as text.' That way the layer object can be updated, such as by applying symbology from the existing layer from which it was copied.
Étapes pour reproduire
ID de bogue: BUG-000105415
Logiciel: