<?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: Placeholder Variables in Schript in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368642#M12679</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also, I bet you can drop the "\" stuff in the SQL. I think this confusing \ notation is a holdover formatting thing for shapefiles/dbf tables from v9.0 - 9.2, but not necessary in v9.3+&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#so instead of this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = '%s'" % feature_label&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Select_analysis(locationstands, outfeatureclass, "identify = '%s'" % feature_label)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Nov 2010 21:29:04 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2010-11-10T21:29:04Z</dc:date>
    <item>
      <title>Placeholder Variables in Schript</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368639#M12676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i wrote the following script. it is supposed to select feature classes out of a featuredataset, based on the feature class stored in another geodatabase. it works fine so far. but i want to make it more flexible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in the following line for example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;if FeatureToPoint == "in_memory\\A_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'A'"); arcpy.AddMessage("worksA")&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"in_memory\\A_FeatureToPoint" shall be somehow get connected to "\"identify\" = 'A'". so the two "A"s shall get connected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i have a hard time expressing what i want. i hope you guys understands me and can help me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;uli&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is the full code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;# Import:&lt;BR /&gt;import arcpy&lt;BR /&gt;import sys&lt;BR /&gt;import os&lt;BR /&gt;from arcpy import env&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# Variables:&lt;BR /&gt;&lt;BR /&gt;FeatureToPoint = arcpy.GetParameterAsText(0)&lt;BR /&gt;locationstands = arcpy.GetParameterAsText(1)&lt;BR /&gt;outfeatureclass = arcpy.GetParameterAsText(2)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if FeatureToPoint == "in_memory\\A_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'A'"); arcpy.AddMessage("worksA")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\B_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'B'"); arcpy.AddMessage("worksB")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\C_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'C'"); arcpy.AddMessage("worksC")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\D_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'D'"); arcpy.AddMessage("worksD")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\E_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'E'"); arcpy.AddMessage("worksE")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\F_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'F'"); arcpy.AddMessage("worksF")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\G_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'G'"); arcpy.AddMessage("worksG")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\H_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'H'"); arcpy.AddMessage("worksH")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\I_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'I'"); arcpy.AddMessage("worksI")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\J_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'J'"); arcpy.AddMessage("worksJ")&lt;BR /&gt;elif FeatureToPoint == "in_memory\\AA_FeatureToPoint": arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = 'AA'"); arcpy.AddMessage("worksAA")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;else: arcpy.AddMessage("doesntwork")&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 19:04:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368639#M12676</guid>
      <dc:creator>UlrichStroetz</dc:creator>
      <dc:date>2010-11-10T19:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Placeholder Variables in Schript</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368640#M12677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perhaps something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
feature_label = arcpy.GetParameterAsText(0) # String
locationstands = arcpy.GetParameterAsText(1)
outfeatureclass = arcpy.GetParameterAsText(2)

if FeatureToPoint == "in_memory\\%s_FeatureToPoint" % feature_label: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = '%s'" % feature_label)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("works%s" % feature_label)
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError("No match for feature label %s" % feature_label)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:05:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368640#M12677</guid>
      <dc:creator>NiklasNorrthon</dc:creator>
      <dc:date>2021-12-11T17:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Placeholder Variables in Schript</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368641#M12678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks, i will give it a try.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 21:10:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368641#M12678</guid>
      <dc:creator>UlrichStroetz</dc:creator>
      <dc:date>2010-11-10T21:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Placeholder Variables in Schript</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368642#M12679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also, I bet you can drop the "\" stuff in the SQL. I think this confusing \ notation is a holdover formatting thing for shapefiles/dbf tables from v9.0 - 9.2, but not necessary in v9.3+&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#so instead of this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Select_analysis(locationstands, outfeatureclass, "\"identify\" = '%s'" % feature_label&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Select_analysis(locationstands, outfeatureclass, "identify = '%s'" % feature_label)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 21:29:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368642#M12679</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-10T21:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Placeholder Variables in Schript</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368643#M12680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;okay, i am quite knew to this. just started using python last week.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i changed the code to the following&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
FeatureToPoint = arcpy.GetParameterAsText(0)
feature_label = arcpy.GetParameterAsText(1)
locationstands = arcpy.GetParameterAsText(2)
outfeatureclass = arcpy.GetParameterAsText(3)



if FeatureToPoint == "U:\\Intern\\Ulrich\\fairbanks_biomass\\test.gdb\\%s_FeatureToPoint" % feature_label: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Select_analysis(locationstands, outfeatureclass, "identify = '%s'" % feature_label)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("works%s" % feature_label)

else: arcpy.AddError("doesntwork")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and i made the "feature_label" parameter to string. but what shall i now put in there? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is the part of my model, it might help to understand the process&lt;/SPAN&gt;&lt;IMG src="http://img600.imageshack.us/img600/7120/asdjy.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:05:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368643#M12680</guid>
      <dc:creator>UlrichStroetz</dc:creator>
      <dc:date>2021-12-11T17:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Placeholder Variables in Schript</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368644#M12681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;arcpy.Select_analysis(locationstands, outfeatureclass, "identify = '%s'" % feature_label) &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it seems to work. thank you guys!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 20:47:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/placeholder-variables-in-schript/m-p/368644#M12681</guid>
      <dc:creator>UlrichStroetz</dc:creator>
      <dc:date>2010-11-12T20:47:48Z</dc:date>
    </item>
  </channel>
</rss>

