<?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: Model Builder - How to remove selected data from a shapefile? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326249#M11501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can zip the toolbox in which the model resides...zip it with a few output shapefiles if you can.&amp;nbsp; ...or if too big, zip separately and post, no need to post your entire output...just a sample.&lt;BR /&gt;I may not be able to pinpoint this today (as I explained I am not in the office), but I bet once you post your zip, there are ModelBuilder experts that can fix it for you quickly!&amp;nbsp; I still suspect your iterator -- are you sure it is 'aware' of the FCtoFC part of the process??&lt;BR /&gt;&lt;BR /&gt;(oops, I meant go to Windows Explorer, select and zip the toolbox [tbx extension], etc.)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All of the data was too big for the size limits. I uploaded it to google drive here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.google.com/folder/d/0B_wIIORblfXkMENRMlNISm94Mm8/edit"&gt;https://docs.google.com/folder/d/0B_wIIORblfXkMENRMlNISm94Mm8/edit&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;shoreline.zip contains the shapefile input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dem.zip contains two DEMs for use as the contents of a folder for the iterator's needed directory input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been experimenting with Model Builder a bit, so there are some unneeded tools in that toolbox.&amp;nbsp; The relevant two are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Lidar Shoreline Slope Step 1" and "DEM to Slope Points (Sub-model)"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Jan 2013 20:52:06 GMT</pubDate>
    <dc:creator>RussellQuintero</dc:creator>
    <dc:date>2013-01-09T20:52:06Z</dc:date>
    <item>
      <title>Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326241#M11493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am attempting to automate a process I have historically done manually using model builder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far I have managed to successfully convert one shapefile to points, and then iterate through multiple rasters to extract the values of those rasters to points, creating multiple shapefiles.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is where I run into problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some of those newly created shapefiles contain invalid data, with values of -9999 in a field showing the raster had no data there.&amp;nbsp; I want to remove that data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried the Analysis toolbox "Select" tool with the SQL query set to "Field Name" &amp;lt;&amp;gt; -9999, but it returns an error 000229.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried "Feature Class to Feature Class" (FC2FC) with the same SQL query, and it says the geometry is invalid.&amp;nbsp; When I try and open the file outside of Model Builder using FC2FC, it says it is unusable. If I use "Add Data" to add the shapefile to my current map, and then use FC2FC, it can suddenly use the file just fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my questions here are two-fold:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) What is the proper way in Model Builder to remove selected data from a shapefile?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) How do I create a tool in Model Builder that will run without requiring that intermediate data be added to the map?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 17:56:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326241#M11493</guid>
      <dc:creator>RussellQuintero</dc:creator>
      <dc:date>2013-01-09T17:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326242#M11494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How about modifying your query with, say, "Field Name" &amp;lt; -999 (or try '=' since that is what you want to delete, correct?), and test to see what selected features there are as a result, use Get Count...if a count returned is the entire feature class count, then you know the query didn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can use Delete Features to get rid of the features once the selected set meets your criteria.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 18:27:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326242#M11494</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-09T18:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326243#M11495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;How about modifying your query with, say, "Field Name" &amp;lt; -999 (or try '=' since that is what you want to delete, correct?), and test to see what selected features there are as a result, use Get Count...if a count returned is the entire feature class count, then you know the query didn't work.&lt;BR /&gt;&lt;BR /&gt;Then you can use Delete Features to get rid of the features once the selected set meets your criteria.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When doing it manually, I've been opening the attribute table, selecting the invalid data, and deleting it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When doing this in Model Builder, the two options select the data that matches the query, so I need everything except -9999 data. If I select the data "Field Name" = -9999, and then delete the selection, how do I keep the other data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did try changing it to &amp;gt;-9999 instead of &amp;lt;&amp;gt; but I get exactly the same error of no supported geometry, which appears to be what it has decided to call the error where it can't open the file when it isn't loaded into the map, as mentioned in my first post. A rather frustrating requirement for an intermediate data product.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 18:38:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326243#M11495</guid>
      <dc:creator>RussellQuintero</dc:creator>
      <dc:date>2013-01-09T18:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326244#M11496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you Delete Features with a selected set on the layer, it should only delete selected - the remainder should be untouched.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Still, it is a good idea to make sure that you have a selection with a count - if there's no selected features, the tool politely deletes the entire dataset and generates 'empty output'...that's kind of alarming!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In short, see this pseudocode:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if not Count &amp;lt; total count:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'whoa, better stop here...tell someone something unexpected has occurred'
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.deleteFeatures(features)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Results may vary, so always check what's actually going on in your code!&amp;nbsp; Not sure what you mean about having invalid geometry - do you have points in a layer as you initially stated?...or are you trying to access an intermediate layer which is not persisted?&amp;nbsp; One more thing, not sure how your gp environment is set up, but you have to have the overwriteoutputs property on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT-&amp;nbsp; So if it is the case you cannot access these 'invalid' features, then try Repair Geometry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:27:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326244#M11496</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2021-12-11T15:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326245#M11497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When you Delete Features with a selected set on the layer, it should only delete selected - the remainder should be untouched.&lt;BR /&gt;Still, it is a good idea to make sure that you have a selection with a count - if there's no selected features, the tool politely deletes the entire dataset and generates 'empty output'...that's kind of alarming!&lt;BR /&gt;&lt;BR /&gt;In short, see this pseudocode:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if not Count &amp;lt; total count:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'whoa, better stop here...tell someone something unexpected has occurred'
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.deleteFeatures(features)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Results may vary, so always check what's actually going on in your code!&amp;nbsp; Not sure what you mean about having invalid geometry - do you have points in a layer as you initially stated?...or are you trying to access an intermediate layer which is not persisted?&amp;nbsp; One more thing, not sure how your gp environment is set up, but you have to have the overwriteoutputs property on.&lt;BR /&gt;&lt;BR /&gt;EDIT-&amp;nbsp; So if it is the case you cannot access these 'invalid' features, then try Repair Geometry.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for all of the responses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First, let's back up to the use of code at all.&amp;nbsp; In Model Builder, I'm just dragging in tools. My intention is to output a tool I can use directly from the toolbox, not a python script. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How does one add code like that within model builder?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now to move on to what I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Inputs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A directory with rasters&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A shapefile with line features&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I pass the shapefile through "Feature Vertices to Points" to produce a set of point features. This serves as an input to the sub-model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The submodel takes in the directory and the point features.&amp;nbsp; An iterator opens each raster in turn, uses "Extract values to points" to extract the raster data onto the points. The output is then used as the input of the "Feature Class to Feature Class" tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So yes, the input is an intermediate data item, although it when it crashes it doesn't seem to clean up the intermediate data and the shapefile persists for me to open.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:27:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326245#M11497</guid>
      <dc:creator>RussellQuintero</dc:creator>
      <dc:date>2021-12-11T15:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326246#M11498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay, I think I see - and the pseudocode was just to 'present' the idea, you can add things like checking for preconditions to a model, also Delete Features is a tool you can drag into a model as well...but looks like you may have a problem with your iterator, and possibly when it crashes it is creating 'malformed' output, ghost output, if you will....&amp;nbsp; It would help if you posted your model, although I am not in the office now to take a look at it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I suggest this though at least to try to isolate the error - your spatial analyst tool has the syntax:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExtractValuesToPoints (in_point_features, in_raster, out_point_features, {interpolate_values}, {add_attributes})&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...or, say this, if this makes better sense:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExtractValuesToPoints(inPointFeatures, inRaster, outPointFeatures, "INTERPOLATE", "VALUE_ONLY")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So your iterator must be feeding the raster dataset in for the 2nd param inRaster, shown above -- your inPointFeatures can remain constant but that is where you must be getting 'no value' data, where there is nothing spatially coincident with the currently used raster dataset.&amp;nbsp; It may be more efficient to 'preprocess' or 'qualify' points (possibly with the extent environment) with the extraction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, you have to somehow provide a mechanism to rename the outPointFeatures on each iteration...how are you including that?&amp;nbsp; ...could attempt overwriting the same temp fc, but append it or copy it to a permanent location before moving on in the loop; again, must have unique names if copying to a separate fc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would help greatly to 'see' your model.&amp;nbsp; Include any additional error messages and shapefile output, if you can.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 19:34:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326246#M11498</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-09T19:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326247#M11499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If I remove the last step, "Feature Class to Feature Class," the whole process runs fine and produces a stack of shapefiles with points.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I use the %Name% variable to change the name on each iteration, and for the output of FC2FC, I use %Name%_filtered.shp&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I think the iterator is working, it's a problem with the next step.&amp;nbsp; Attached is an image of the model. Is there a way to upload the model itself?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]20612[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 19:45:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326247#M11499</guid>
      <dc:creator>RussellQuintero</dc:creator>
      <dc:date>2013-01-09T19:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326248#M11500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can zip the toolbox in which the model resides...zip it with a few output shapefiles if you can.&amp;nbsp; ...or if too big, zip separately and post, no need to post your entire output...just a sample.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I may not be able to pinpoint this today (as I explained I am not in the office), but I bet once you post your zip, there are ModelBuilder experts that can fix it for you quickly!&amp;nbsp; I still suspect your iterator -- are you sure it is 'aware' of the FCtoFC part of the process??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(oops, I meant go to Windows Explorer, select and zip the toolbox [tbx extension], etc.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 19:53:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326248#M11500</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-09T19:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326249#M11501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can zip the toolbox in which the model resides...zip it with a few output shapefiles if you can.&amp;nbsp; ...or if too big, zip separately and post, no need to post your entire output...just a sample.&lt;BR /&gt;I may not be able to pinpoint this today (as I explained I am not in the office), but I bet once you post your zip, there are ModelBuilder experts that can fix it for you quickly!&amp;nbsp; I still suspect your iterator -- are you sure it is 'aware' of the FCtoFC part of the process??&lt;BR /&gt;&lt;BR /&gt;(oops, I meant go to Windows Explorer, select and zip the toolbox [tbx extension], etc.)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;All of the data was too big for the size limits. I uploaded it to google drive here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.google.com/folder/d/0B_wIIORblfXkMENRMlNISm94Mm8/edit"&gt;https://docs.google.com/folder/d/0B_wIIORblfXkMENRMlNISm94Mm8/edit&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;shoreline.zip contains the shapefile input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dem.zip contains two DEMs for use as the contents of a folder for the iterator's needed directory input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been experimenting with Model Builder a bit, so there are some unneeded tools in that toolbox.&amp;nbsp; The relevant two are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Lidar Shoreline Slope Step 1" and "DEM to Slope Points (Sub-model)"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 20:52:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326249#M11501</guid>
      <dc:creator>RussellQuintero</dc:creator>
      <dc:date>2013-01-09T20:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326250#M11502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, sorry about that, I didn't mean for you to load everything - what's most important is to examine the 'guts' of the model, for extra I wanted to see a couple of your output shapefiles......I'm fairly sure now it is linked to your iterator and how the Value produced from it is used for variable substitution.&amp;nbsp; Just looking again at your last post, the graphic of the model, it doesn't appear you are substituting output names for FCtoFC sensitive to Value.&amp;nbsp; When the model iterates, I think it crashes because the last part is attempting to be a part of the iteration, but the output naming convention doesn't make sense.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just curious, what is the Value text typically...no file extension, correct, and just a name?&amp;nbsp; If Value contains 'extra parts', their is a Parse Path tool to strip out what you need.&amp;nbsp; I think you're okay, but have to be careful and check that when mixing data types as in your model (from raster output, then shapefile output)....to simplify presentation undoubtedly, many of the webhelp examples deal with the same datatype.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I'd look carefully at your inline variable substitution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I downloaded your tbx zip, will take a look at that and your shapefile...let me look at that 1st.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&amp;nbsp; I said Value but meant Name that you are using for in-line substitutions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 21:11:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326250#M11502</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-09T21:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326251#M11503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need in-line substitution for your FC2FC output -- the output workspace can be constant, but the actually fc name must change, so make that %Name%_filtered as you said you tried, but I don't see it in the graphic.&amp;nbsp; (I think the .shp will automatically be applied)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you make sure that you tried that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, FC2FC has an optional where_clause parameter you are not using - is this not where you want to eliminate 'empty' or null records?&amp;nbsp; I think this can be a 'static' query but I'd have to look closer at it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 21:25:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326251#M11503</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-09T21:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326252#M11504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This illustrates what I was thinking, using Make Feature Layer and Delete Features - this way you aren't creating essentially 2 copies of the output...the in-line variable substitution looks fine, although I didn't test it.&amp;nbsp; I would say this as well, to set:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1- the overwriteoutputs geoprocessing env to 'true' (gp options)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2- 'un-check' the intermediate output for your shp output before Make Feature layer (this is now your final output)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3- run a small sample if you can as a test...no need to run everything at once and have to wait, if it needs tweaking.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Notice the query in the 1st pic, may need to tweak that as well.&amp;nbsp; Let me know if that works... interesting.&amp;nbsp; If not, I'd like to 'dissect' it tomorrow when back at the office.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 22:45:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326252#M11504</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-09T22:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326253#M11505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My apologies, first of all, for the number of posts I've made...but bear with me, I've developed a keen interest in this part of the topic dealing with iterators and in-line var substitution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You said your problem was isolated in the copy of features without data from that same source that satisfies a query...see my last post.&amp;nbsp; The idea was to use FC2FC with a query to output to a in-line sub determined output.&amp;nbsp; An alternate idea was to modify the point shapefile output with Delete Features with a query entered at the tool, Make Feature Layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please see the attached model graphic (and toolbox zip containing that model).&amp;nbsp; What I have done is 'similate' your Rasters iterator with a Feature Classes iterator (I do not have the Spatial Analyst extension, and didn't need to simulate that part of the model anyway).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me explain:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Extract Values to Points in your model was substituted for Copy Features in my model to simulate feature class output (points in your case; polygons in mine).&amp;nbsp; The output in-line var sub name for yours is %Name%_raw.shp; for mine it is %Name%_CF (CF stands for Copy Features).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used Make Feature Layer and Delete Features to operate on the individual CF outputs, essentially removing the features from each those satisfying the query, "PARCELNO" LIKE '2166%', which is a static query (the '%' in this case is a SQL wildcard character).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This ran without error, making each copy for each fc found in the gdb, appending text to the input name, then proceeding to execute the same SQL query on each CF output via Make Feature Layer....once there is a feature layer 'handle' on those records to delete, this is in turn fed into Delete Features (no error trapping provided).&amp;nbsp; The final outputs are the individual CF feature classes with the designated features removed - carried out by Make Feature Layer and Delete Features, 'moderated' or fed by the iterator.&amp;nbsp; So a 2nd 'hard copy' output was not necessary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps...ordinarily I would script this type thing in Python, but this is an interesting way to do it too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're still having problems, I would examine the 'intermediate' output and the query to make sure those are valid.&amp;nbsp; Hope it isn't a bug somewhere....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wayne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 18:05:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326253#M11505</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-10T18:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder - How to remove selected data from a shapefile?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326254#M11506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Forgot the toolbox, in case you want to examine it...see attached.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 18:15:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/model-builder-how-to-remove-selected-data-from-a/m-p/326254#M11506</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-01-10T18:15:57Z</dc:date>
    </item>
  </channel>
</rss>

