<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python Noob in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475455#M37239</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So you mean you want to add a shapefile to your TOC? I think people were confused because opening and adding a shapefile mean two different things to most people.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you want is&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.MakeFeatureLayer_management(yourShapefile, "TOC name")
arcpy.RefreshActiveView()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:01:13 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2021-12-11T21:01:13Z</dc:date>
    <item>
      <title>Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475448#M37232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am an amatuer when it comes to python so could someone please help with my simple questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Is the arcpy module available in ArcGIS 9.3 (I think it is 10 / python 2.6)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) What is the python code to open a shapefile in ArcGIS 9.3 (not using arcpy module)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Josh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 00:31:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475448#M37232</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2011-11-24T00:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475449#M37233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1&amp;nbsp; No, arcpy is for version 10&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2&amp;nbsp; check the 9.3 help files for "searchcursor"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 16:45:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475449#M37233</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-11-24T16:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475450#M37234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Dan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I checked out the searchcursor... not sure how you use this to open a shapefile up in ArcMap. I have used cursors before in VBA code to go through each record.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I call the python script from a toolbox within an open session of ArcMap. I want it to open a shapefile (chosen by the user with a dialog box). I can get the filepath to the script with the dialog box but I have no idea how to add that shapefile to the arcmap session.. It is easy with arcpy, but I don't have that luxury.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Josh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 20:03:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475450#M37234</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2011-11-24T20:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475451#M37235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;makefeaturelayer ?&amp;nbsp; Is that what you are after?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 21:28:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475451#M37235</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-11-24T21:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475452#M37236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Greetings,&lt;BR /&gt;&lt;BR /&gt;I am an amatuer when it comes to python so could someone please help with my simple questions:&lt;BR /&gt;&lt;BR /&gt;1) Is the arcpy module available in ArcGIS 9.3 (I think it is 10 / python 2.6)&lt;BR /&gt;2) What is the python code to open a shapefile in ArcGIS 9.3 (not using arcpy module)?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Josh&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How about this? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;shapefile = "c://temp//shapefile.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's a joke, kind of. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What exactly are you trying to do ?&amp;nbsp; What do you mean by open?&amp;nbsp; Why can't the user add a shapefile to ArcMap and then open its attribute table or what ever it wants to do there? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's the desired process or end result?&amp;nbsp; What does the user need to do with the shapefile once its been opened?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2011 20:08:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475452#M37236</guid>
      <dc:creator>JamesHood</dc:creator>
      <dc:date>2011-11-29T20:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475453#M37237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ok I was in your shoes not two months ago. First off there a few things you need to understand with python firstly being how geoprocessing works from python to arcgis. A lot of useinfo is in the help menu about python, main points to learn first are parameters, workspaces, and the tools in the tool box. You can also view the script of any tool by putting inside of a model (model builder) and export that model to a script. You can then view that script and look at how the tool is written. You can also look up a tool through the help menu and read its documentaion which will tell you what parameters do what. I hope this helps you hit the ground running. In regard to your question use the yellow Add Data button to add shapefiles to your mxd.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2011 23:48:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475453#M37237</guid>
      <dc:creator>PatrickFischer1</dc:creator>
      <dc:date>2011-11-29T23:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475454#M37238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings Folks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for being too vague guys!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The shapefile is created during the script (which I created using model builder then adding a few tweaks). It works fine, I have no problems with this basic scripting. All I want to do is open a shapefile that gets created during the script. At the moment the shapefile is created and after the script has run the user has to press the yellow add data button. I think this is inefficient and would like the shapefile to automatically open.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how to open a shapefile in ArcMap using python???&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 00:46:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475454#M37238</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2011-11-30T00:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475455#M37239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So you mean you want to add a shapefile to your TOC? I think people were confused because opening and adding a shapefile mean two different things to most people.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you want is&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.MakeFeatureLayer_management(yourShapefile, "TOC name")
arcpy.RefreshActiveView()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:01:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475455#M37239</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T21:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475456#M37240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thats right, however I can't use arcpy (don't have arcpy module with arcgis 9.3)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 20:11:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475456#M37240</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2011-11-30T20:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475457#M37241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Doesn't matter, it is a basic tool available in any recent python package. You just use your arcgisscripting instance instead of arcpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1867&amp;amp;pid=1865&amp;amp;topicname=Make_Feature_Layer_(Data_Management"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1867&amp;amp;pid=1865&amp;amp;topicname=Make_Feature_Layer_(Data_Management&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 20:25:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475457#M37241</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-11-30T20:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475458#M37242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Doesn't matter, it is a basic tool available in any recent python package. You just use your arcgisscripting instance instead of arcpy.&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1867&amp;amp;pid=1865&amp;amp;topicname=Make_Feature_Layer_(Data_Management"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1867&amp;amp;pid=1865&amp;amp;topicname=Make_Feature_Layer_(Data_Management&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers Matt, I'll try it out&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 00:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475458#M37242</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2011-12-01T00:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475459#M37243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No luck.. Here's some Pseudocode:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;theSession = get the current ArcMap session &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;theSession.addlayer(layer filepath)&amp;nbsp; 'add to TOC&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please note, I mentioned shapefile before, but with some additions to my script it is now a .lyr file I need to add&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have a code sample or could someone please expose the dark secret of how to add a layer to the TOC of the current session. Remember no arcpy (Using ArcGIS 9.3.1)!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 00:37:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475459#M37243</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2011-12-01T00:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475460#M37244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you running this as a script tool or as a separate instance?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 18:10:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475460#M37244</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-12-01T18:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475461#M37245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Are you running this as a script tool or as a separate instance?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As a script tool&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 18:42:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475461#M37245</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2011-12-01T18:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475462#M37246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try posting your entire code, use code blocks, &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;like this&lt;/PRE&gt;&lt;SPAN&gt; and hopefully we can get to the bottom of your problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 18:55:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475462#M37246</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-12-01T18:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475463#M37247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Try posting your entire code, use code blocks, &lt;PRE class="lia-code-sample line-numbers language-none"&gt;like this&lt;/PRE&gt; and hopefully we can get to the bottom of your problem.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OK. All I want to do is add SF_RENDERED to the arcmap TOC. ArcMap session is where the script is run from (from personal arcgis tollbox).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# Import system modules
import sys, string, os, arcgisscripting


# get the shapefile
from Tkinter import * 
import tkFileDialog

# Create the Geoprocessor object
gp = arcgisscripting.create()

master = Tk() 
master.withdraw() #hiding tkinter window 
&amp;nbsp; 
file_path = tkFileDialog.askopenfilename(initialdir="D:\\", title="Open file", filetypes=[("Shapefile",".shp"),("All files",".*")]) 
 
if file_path.find('.shp') == -1:
&amp;nbsp;&amp;nbsp; print "Not a shapefile, quiting"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; master.quit()

 
if file_path != "": 
&amp;nbsp;&amp;nbsp; print "you chose file with path:", file_path
&amp;nbsp;&amp;nbsp; SF = file_path
else: 
&amp;nbsp;&amp;nbsp; print "you didn't open anything!"
&amp;nbsp;&amp;nbsp; sys.exit()
&amp;nbsp;&amp;nbsp; 
def rchop(thestring, ending): 
&amp;nbsp; if thestring.endswith(ending): 
&amp;nbsp;&amp;nbsp;&amp;nbsp; return thestring[:-len(ending)] 
&amp;nbsp; return thestring

#get the tolerance
toly = 0
from tkMessageBox import askokcancel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

class Quitter(Frame):&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self, parent=None):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Frame.__init__(self, parent)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.pack()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; widget = Button(self, text='Done', command=self.quit)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; widget.pack(expand=YES, fill=BOTH, side=BOTTOM)
&amp;nbsp;&amp;nbsp;&amp;nbsp; def quit(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage('You chose ' + ent.get() + ' for the tolerance...well played!')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toly = ent.get()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage(toly)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage(toly)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #local variables
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SF_Copy = rchop(file_path, '.shp') + '_copy.shp'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SF_Copier = SF_Copy + " #"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SF_COUNT = rchop(file_path, '.shp') + '_collectevents.shp'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SF_Integrated = rchop(file_path, '.shp') + '_integrated.shp'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SF_Rendered = rchop(file_path, '.shp') + '_rendered'

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Load required toolboxes...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("D:/ArcGIS/ArcToolbox/Toolboxes/Spatial Statistics Tools.tbx")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddToolbox("D:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ## Process: Copy Features...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CopyFeatures_management(SF, SF_Copy, "", "0", "0", "0")
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage('Backup copy has been made')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ## Process: Integrate...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Integrate_management(SF_Copier, toly)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage('Integration completed')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ## Process: Collect Events...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CollectEvents_stats(SF_Copy, SF_COUNT)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage('Events have been collected')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SF_COUNT = SF_COUNT.replace("/","\\")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SF_Rendered = SF_Rendered.replace("/","\\")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage('Creating ' + SF_COUNT)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage('Creating ' + SF_Rendered)


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Count Rendering...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CountRenderer_stats(SF_COUNT, "ICOUNT", SF_Rendered, "5", "bright_pink" ,"")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Frame.quit(self)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.addmessage('done and dusted')
 
 #this bit was me having a crack at adding it to the TOC
 gp.MakeFeatureLayer_management(SF_Rendered, "Untitled")
 gp.RefreshActiveView()

root = Tk()
root.title("Enter the tolerance value for integrate tool")
L1 = Label(root, text="Enter the tolerance value for integrate tool (m):&amp;nbsp; ")
L1.pack( side = LEFT)

ent = Entry(root)
ent.insert(0, '20')&amp;nbsp;&amp;nbsp;&amp;nbsp; 
#ent.pack(side=TOP, fill=X)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
ent.pack(side=LEFT)
ent.focus()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
#ent.bind('&amp;lt;Return&amp;gt;', (lambda event: quitter()))
ent.bind(toly, (lambda event: quitter()))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
#btn = Button(root, text='Fetch', command=fetch)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
#btn.pack(side=LEFT)
Quitter(root).pack(side=RIGHT)
root.mainloop()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:01:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475463#M37247</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2021-12-11T21:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475464#M37248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This might help: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/20040-adding-processed-shapefiles-to-ArcMap-automatically"&gt;http://forums.arcgis.com/threads/20040-adding-processed-shapefiles-to-ArcMap-automatically&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 13:27:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475464#M37248</guid>
      <dc:creator>RuthEmerick</dc:creator>
      <dc:date>2011-12-02T13:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475465#M37249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;How about this? &lt;BR /&gt;&lt;BR /&gt;shapefile = "c://temp//shapefile.shp"&lt;BR /&gt;&lt;BR /&gt;That's a joke, kind of. &lt;BR /&gt;What exactly are you trying to do ?&amp;nbsp; What do you mean by open?&amp;nbsp; Why can't the user add a shapefile to ArcMap and then open its attribute table or what ever it wants to do there? &lt;BR /&gt;&lt;BR /&gt;What's the desired process or end result?&amp;nbsp; What does the user need to do with the shapefile once its been opened?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jahood, do you have any input? You posed several questions and I think I answered them for you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2011 19:13:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475465#M37249</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2011-12-04T19:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475466#M37250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm going to develop this as a tool in trusty old Arcobjects VBA...it's crazy how hard it is to do something so simple...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help folks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 04:00:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475466#M37250</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2011-12-05T04:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Python Noob</title>
      <link>https://community.esri.com/t5/python-questions/python-noob/m-p/475467#M37251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello good people.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just updating this thread with VBA code / tool that I have used instead of a python script. Thanks for your help everyone...I'm going out to buy some python books at lunch time in readiness for our upgrade to ArcGIS 10!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Private Sub ICEWR_Click()
On Error GoTo ERRORR
Dim pGxDialog As IGxDialog
Set pGxDialog = New GxDialog

pGxDialog.ButtonCaption = "Add"
pGxDialog.StartingLocation = "D:\Data"
pGxDialog.Title = "Add the shapefile you wish to integrate and collect events"

pGxDialog.AllowMultiSelect = True

Dim pLFilter As IGxFile
Set pLFilter = New GxFile

Dim pGxFilter As IGxObjectFilter
Set pGxFilter = New GxFilterShapefiles

Set pGxDialog.ObjectFilter = pGxFilter

Dim pLayerFiles As IEnumGxObject
pGxDialog.DoModalOpen 0, pLayerFiles

'Dim pLayerFile As IGxObject
Dim pLayerFile As IGxDataset
Set pLayerFile = pLayerFiles.Next

'Dim pGxLayer As IGxLayer
Dim pGxLayer As IFeatureLayer
Dim pGxFeatureClass As IFeatureClass
Set pGxFeatureClass = pLayerFile.Dataset
Set pGxLayer = New FeatureLayer
Set pGxLayer.FeatureClass = pGxFeatureClass
pGxLayer.Name = pGxFeatureClass.AliasName
theshapefile = pGxLayer.Name
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument



pMxDoc.AddLayer pGxLayer
pMxDoc.ActiveView.Refresh
pMxDoc.UpdateContents
Dim pMap As IMap
Set pMap = pMxDoc.FocusMap

For i = 0 To pMap.LayerCount - 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; If pMap.Layer(i).Name = theshapefile Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; getindex = i
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
Next i


Dim pl2 As IDataLayer2
Set pl2 = pMxDoc.FocusMap.Layer(getindex)
Dim pdsNAME As IDatasetName
Set pdsNAME = pl2.DataSourceName
theworkarea = pdsNAME.WorkspaceName.PathName &amp;amp; "\"


SF_Copy = theworkarea &amp;amp; theshapefile &amp;amp; "_copy.shp"
SF_Copier = SF_Copy &amp;amp; " #"
SF_COUNT = theworkarea &amp;amp; theshapefile &amp;amp; "_collectevents.shp"
SF_INTEGRATED = theworkarea &amp;amp; theshapefile &amp;amp; "_integrated.shp"
SF_Rendered = theworkarea &amp;amp; theshapefile &amp;amp; "_rendered"

toly = InputBox("Enter a tolerance value for integration please", "Tolerance")
' Create the Geoprocessor object
Set gp = CreateObject("esriGeoprocessing.GPDispatch.1")

' Load required toolboxes...
gp.AddToolbox "D:/ArcGIS/ArcToolbox/Toolboxes/Spatial Statistics Tools.tbx"
gp.AddToolbox "D:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx"

' Process: Copy Features...
gp.CopyFeatures_management theshapefile, SF_Copy, "", "0", "0", "0"
gp.Integrate_management SF_Copier, toly
gp.CollectEvents_stats SF_Copy, SF_COUNT
gp.CountRenderer_stats SF_COUNT, "ICOUNT", SF_Rendered, "5", "bright_pink", ""

Exit Sub
ERRORR:
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "You may have already run this and forgotten to delete files created last time", vbCritical, "Error" 'will add a file check and delete to overcome this problem when i get time
End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:01:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-noob/m-p/475467#M37251</guid>
      <dc:creator>JoshMoloney</dc:creator>
      <dc:date>2021-12-11T21:01:19Z</dc:date>
    </item>
  </channel>
</rss>

