Export Feature Set using Model Builder

1606
2
Jump to solution
11-01-2016 09:22 AM
MattColwin
New Contributor II

I have created a model in Model Builder that utilizes the ESRI Ready-To-Use Service called "Trace Downstream". This takes an input point file or an input feature set (created by clicking on the map) and performs some trace downstream functions. When viewed in the model, the output is a "Trace Line" that is a type Feature Set. Once the tool runs and the output shows in the Table of Contents, the data type is "InMemory Feature Class". I have been trying to figure out a way to take this output Feature Set and export it or convert it into a local piece of data using Model Builder. I have tried Copy Features, Make Feature Layer, Feature Class to Feature Class, etc. and none of them will accept the Feature Set as the input feature.

When I do a manual "Data > Export Data" I am able to take the resulting InMemory Feature Class and export it as a local Feature Class, but I want to do this within the Model Builder.

Thanks in advance for any help.

0 Kudos
1 Solution

Accepted Solutions
curtvprice
MVP Esteemed Contributor

Have you tried running Copy Features within a Calculate Value tool?

Expression

cf(r"%Trace output%")

Code Block

def cf(trace):
  arcpy.CopyFeatures_management(trace, "in_memory\\trace_feat")
  return "in_memory\\trace_feat"

Data type: 

Feature class

View solution in original post

2 Replies
curtvprice
MVP Esteemed Contributor

Have you tried running Copy Features within a Calculate Value tool?

Expression

cf(r"%Trace output%")

Code Block

def cf(trace):
  arcpy.CopyFeatures_management(trace, "in_memory\\trace_feat")
  return "in_memory\\trace_feat"

Data type: 

Feature class

MattColwin
New Contributor II

This worked great, thanks!

0 Kudos