<?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: Create Feature Name from GetParametersAsText()  in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-feature-name-from-getparametersastext/m-p/296225#M22880</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm"&gt;ListFeatureClasses—ArcPy Functions | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you set a workspace?&amp;nbsp; ie the path to the geodatabase?&lt;/P&gt;&lt;P&gt;If you don't, then just the featureclass name isn't going to do anything, hence this line in the code examples&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #595959; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.85em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.4rem; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;arcpy.env.workspace = &lt;/SPAN&gt;&lt;SPAN style="color: #c41a16; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;"c:/base/gdb.gdb"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code snippet up to and including the part where you get the featureclass name and use ListFields would help.&lt;/P&gt;&lt;P&gt;Also, when testing throw in some 'print' statements in before and after using a function to make sure what goes in is correct and what goes out is correct&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Apr 2019 12:36:35 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2019-04-29T12:36:35Z</dc:date>
    <item>
      <title>Create Feature Name from GetParametersAsText()</title>
      <link>https://community.esri.com/t5/python-questions/create-feature-name-from-getparametersastext/m-p/296224#M22879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;New to Python and rarely post here so I am sure my question formatting is&amp;nbsp;not correct. No errors to show because I do because test code runs but returns nothing&amp;nbsp;and no code to post because it is mostly in functions and not tied to the issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to "create a fire box feature class name based on the user provided box number". This feature class name will be used as a parameter for a function or assigned a variable that will be used as a parameter in a function (in a script not in a tool) that will check for fields existence and add fields if needed.&lt;/P&gt;&lt;P&gt;I am required to have,&amp;nbsp;&lt;EM&gt;boxname = arpy.GetParameterAsText(0)&lt;/EM&gt; with the input being the "box number", 35 for example.&lt;/P&gt;&lt;P&gt;The feature classes already exist in a geodatabase as FireBoxMap_35 etc. (there are 43 total features), so I know I do not want to replace or add the feature class name into the geodatabase and I can't change the names.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previous script in this assignment (without functions), used f&lt;EM&gt;cname = arcpyListFeatureClasses("FireBoxMap*")&lt;/EM&gt; to find all feature classes so I have tried &lt;EM&gt;fcname = acrpy.ListFeatureClasses("FireBoxMap*" + boxname)&lt;/EM&gt; which gives me the correct name but does not work once I pass&amp;nbsp;it to&amp;nbsp;&lt;EM&gt;arcpy.ListFields() &lt;/EM&gt;to test it,&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;no errors, just no fields. Going to test&amp;nbsp;concatenating and SQL queries but have not worked out if that is the way to go here or how to put&amp;nbsp;it together. Any assistance on this would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2019 04:08:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-feature-name-from-getparametersastext/m-p/296224#M22879</guid>
      <dc:creator>JCann</dc:creator>
      <dc:date>2019-04-29T04:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create Feature Name from GetParametersAsText()</title>
      <link>https://community.esri.com/t5/python-questions/create-feature-name-from-getparametersastext/m-p/296225#M22880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm"&gt;ListFeatureClasses—ArcPy Functions | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you set a workspace?&amp;nbsp; ie the path to the geodatabase?&lt;/P&gt;&lt;P&gt;If you don't, then just the featureclass name isn't going to do anything, hence this line in the code examples&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f8f8f8; color: #595959; font-family: 'Consolas','Andale Mono','Lucida Console','Monaco',monospace; font-size: 0.85em; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; line-height: 1.4rem; orphans: 2; overflow-wrap: normal; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;arcpy.env.workspace = &lt;/SPAN&gt;&lt;SPAN style="color: #c41a16; font-family: &amp;amp;quot; consolas&amp;amp;quot;,&amp;amp;quot;andale mono&amp;amp;quot;,&amp;amp;quot;lucida console&amp;amp;quot;,&amp;amp;quot;monaco&amp;amp;quot;,monospace; font-size: 14.46px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;"c:/base/gdb.gdb"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code snippet up to and including the part where you get the featureclass name and use ListFields would help.&lt;/P&gt;&lt;P&gt;Also, when testing throw in some 'print' statements in before and after using a function to make sure what goes in is correct and what goes out is correct&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2019 12:36:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-feature-name-from-getparametersastext/m-p/296225#M22880</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-04-29T12:36:35Z</dc:date>
    </item>
  </channel>
</rss>

