What do you mean by "cut & paste annotations"?
Copy Features respects feature selections on layers....
The output of CopyFeatures is a feature class, not a layer.
oa is a layer, not a Feature Class.
Mark,
How is oa not a Feature Class? ArcCatalog and ArcMap list the Data Type as a File Geodatabase Feature Class.
The feature layer at its core is a feature class, but the layer itself is on top of that and is a Desktop display wrapper that defines its output location as a layer designed for placement in a map dataframe, not as a feature class file in a directory. This geoprocessing tool cannot use the layer wrapper that hides the feature class information from the tool.
That is why when you interactively complete the tool you cannot drag a layer into the output text box of the CopyFeatures tool or type a layer name into the output of the tool. You have to navigate directories to fill in that part of the tool dialog with a full feature class path or you must only connect raw feature class variables or tool outputs that store direct pointers to a feature class path. Layers are only an indirect pointer to a feature class, not a direct pointer.
Although many people use the term layer indiscriminately to refer to both what you see in the TOC of a Desktop map and the underlying data in ArcCatalog, technically the term is actually only correctly used to refer to what you see in a Desktop map TOC. The data stored on disk seen in ArcCatalog is only a feature class that has its own independent existence even if it was never used to create a layer in a Desktop map TOC. Likewise, layers can exist without a feature class (when a layer has a red exclamation mark due to a lost data connection it is still a layer even though it has no feature class and virtually no real functionality).
import arcpy arcpy.env.workSpace = "C:\Working\MyData\Python.gdb" arcpy.env.overwriteOutput = 'True' mxd = arcpy.mapping.MapDocument ("CURRENT") df = arcpy.mapping.ListDataFrames (mxd)[0] pa = arcpy.mapping.ListLayers(mxd, "PropertyAnno", df)[0] oa = arcpy.mapping.ListLayers(mxd, "OwnerAnno", df)[0] arcpy.AddMessage(pa.name) arcpy.AddMessage(oa.name) arcpy.CopyFeatures_management("pa", "oa")
pa = arcpy.mapping.ListLayers(mxd, "PropertyAnno", df)[0] # pa is the input: it is a layer in arcMap. # Copy Features accepts a layer as input, # so you can have selected or query defined subsets of the FC features oa = arcpy.mapping.ListLayers(mxd, "OwnerAnno", df)[0] # oa is supposed to be the output: it is a layer in arcMap. # Copy Features cannot accept a layer as output; it must write to a fc on disc # since the oa layer is in your open ArcMap session, the underlying FC is locked # so you cannot write to the underlyng FC either fc = r"C:\Working\MyData\Python.gdb\AnAnnotationFC" # fc is an annotation FC in the same gdb, but is NOT in the open mxd # try writing to that arcpy.CopyFeatures_management(pa, fc)