<?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 Modify custom Python script to general Toolbox in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/modify-custom-python-script-to-general-toolbox/m-p/134693#M1812</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am new to python scripting and began by creating a specific tool. Now, I want to modify the script for any feature class.&amp;nbsp; How would I modify the script to input/clip/output any feature class?&amp;nbsp; GetParameterAsText?&amp;nbsp; Then, I intend to add the script to a toolbox.&amp;nbsp; The script is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Import system modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Workspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = "E:\User\MillageCode"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in_features = "Sales_2006.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;clip_features = "EagleHarborSales_temp.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out_feature_class = "Output_temp5.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Clip the Sales_2006 shapefile to the EagleHarborSales_temp shapefile&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Clip_analysis(in_features, clip_features, out_feature_class)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Info (arcpy commands are case sensitive)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print arcpy.GetMessages()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jul 2013 13:42:31 GMT</pubDate>
    <dc:creator>JacobDrvar</dc:creator>
    <dc:date>2013-07-15T13:42:31Z</dc:date>
    <item>
      <title>Modify custom Python script to general Toolbox</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/modify-custom-python-script-to-general-toolbox/m-p/134693#M1812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am new to python scripting and began by creating a specific tool. Now, I want to modify the script for any feature class.&amp;nbsp; How would I modify the script to input/clip/output any feature class?&amp;nbsp; GetParameterAsText?&amp;nbsp; Then, I intend to add the script to a toolbox.&amp;nbsp; The script is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Import system modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Workspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = "E:\User\MillageCode"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in_features = "Sales_2006.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;clip_features = "EagleHarborSales_temp.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out_feature_class = "Output_temp5.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Clip the Sales_2006 shapefile to the EagleHarborSales_temp shapefile&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Clip_analysis(in_features, clip_features, out_feature_class)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Info (arcpy commands are case sensitive)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print arcpy.GetMessages()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2013 13:42:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/modify-custom-python-script-to-general-toolbox/m-p/134693#M1812</guid>
      <dc:creator>JacobDrvar</dc:creator>
      <dc:date>2013-07-15T13:42:31Z</dc:date>
    </item>
  </channel>
</rss>

