Python - How to add 'Make Feature Layer' tool output to MXD automatically?

المشرف العام

Administrator
طاقم الإدارة
Can someone elaborate on Jason's answer from this 2013 post? I'm struggling to impletment a similar strategy. A code sample would be helpful. Thanks!

How to add ArcPy Feature Layer to ArcMap automatically?

Recap:

Q. With Python, how do I get the MakeFeatureLayer_management layer that is temporarily created to add to ArcMap automatically after the tool is run?

A. Add an output parameter of type Feature Layer to your tool. Set its value to the name of the XY Layer you make with the tool at the end of your script. This lets the geoprocessing framework know that you really meant to make that layer permanent (and not just as intermediate data) and to add it to the table of contents.



أكثر...
 
أعلى