<?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 Strange behaviour of script tool parameters of FeatureLayer/Featureclass data type in 10.4 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/strange-behaviour-of-script-tool-parameters-of/m-p/79079#M6381</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have encountered two problems when working with script tools in ArcGIS 10.4.1.5686:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a script tool to a toolbox and define an input parameter of type FeatureLayer. I then opened&amp;nbsp;the tool in ArcMap and dragged one of my layers from the table of contents into the parameter input box. An error sign appeared by the tool parameter saying "Dataset soandso does not exist or is not supported", which is not true.&amp;nbsp;It seems the feature layer parameter behaves as a an input box for type FeatureClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another problem was with an output parameter. I created an output parameter of type FeatureClass and set its direction to "Output". When I run the tool, the output was produced but it is not added to the map document (Add output of geoprocessing operations to display is checked) and the result object suggests the output is a table and not a feature class. I can see the resulting feature class in catalog window OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you experienced anything like this?&lt;/P&gt;&lt;P&gt;Below &amp;nbsp;is preview of result and the script.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/237012_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;copy_feature_layer_as_feature_class&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_fclr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; out &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_fclr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getOutput&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; out

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; __name__ &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"__main__"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; in_feature_layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_feature_class &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_copy &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; copy_feature_layer_as_feature_class&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_feature_layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_feature_class&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fc_copy&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 23:03:02 GMT</pubDate>
    <dc:creator>FilipKrál</dc:creator>
    <dc:date>2021-12-10T23:03:02Z</dc:date>
    <item>
      <title>Strange behaviour of script tool parameters of FeatureLayer/Featureclass data type in 10.4</title>
      <link>https://community.esri.com/t5/python-questions/strange-behaviour-of-script-tool-parameters-of/m-p/79079#M6381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have encountered two problems when working with script tools in ArcGIS 10.4.1.5686:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added a script tool to a toolbox and define an input parameter of type FeatureLayer. I then opened&amp;nbsp;the tool in ArcMap and dragged one of my layers from the table of contents into the parameter input box. An error sign appeared by the tool parameter saying "Dataset soandso does not exist or is not supported", which is not true.&amp;nbsp;It seems the feature layer parameter behaves as a an input box for type FeatureClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another problem was with an output parameter. I created an output parameter of type FeatureClass and set its direction to "Output". When I run the tool, the output was produced but it is not added to the map document (Add output of geoprocessing operations to display is checked) and the result object suggests the output is a table and not a feature class. I can see the resulting feature class in catalog window OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you experienced anything like this?&lt;/P&gt;&lt;P&gt;Below &amp;nbsp;is preview of result and the script.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/237012_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;copy_feature_layer_as_feature_class&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_fclr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; out &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;management&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_fclr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getOutput&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; out

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; __name__ &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"__main__"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; in_feature_layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_feature_class &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_copy &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; copy_feature_layer_as_feature_class&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_feature_layer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_feature_class&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fc_copy&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:03:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strange-behaviour-of-script-tool-parameters-of/m-p/79079#M6381</guid>
      <dc:creator>FilipKrál</dc:creator>
      <dc:date>2021-12-10T23:03:02Z</dc:date>
    </item>
  </channel>
</rss>

