Select to view content in your preferred language

code to attach the resulting feature layer in python

657
3
06-14-2010 02:27 AM
MoinMalik
Emerging Contributor
Hi,

Why a feature layer (SHP file) created from ArcTool automatically attaches in the ArcMap TOC, while same don't if created from Python script ?

In other words, what could be the code to attach the resulting feature layer in python.

Cheers

Moin
0 Kudos
3 Replies
StefanHaglund1
Esri Contributor
Hi Moin,

The easiest way to do that would be to create a script tool from your Python script and run it inside ArcMap.

See: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_creating_script_tools for an overview and http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Adding_a_script_tool for info on how to attach your script to a tool in ArcToolbox.
0 Kudos
MoinMalik
Emerging Contributor
Thanks Nooski for your advise.

However, I have already attached my script in the ArcTool and runs it inside the ArcMap. Actually my script splits large feature into smaller set of features. I want all the resultant feature files to attach automatically in ArcMap.


Regards

Moin:)
0 Kudos
ChrisMathers
Deactivated User
I have been curious about the same thing. I think we may have to wait for arcpy in Arc10 to add files to an open map from python.
0 Kudos