Here's a script I just happened to have lying around, it merges all lines, points and polygons from a database into a new database feature class; there's no field mapping, at this time we just wanted to see all the geometries together without having to load over 1k layers...
A feature class (shapefile or database) can only store one geometry type so it's important to test that before deciding where to put it.
import arcpy, os, sys
# set your parameters input and output database
InDB = sys.argv[1]
OutDB = sys.argv[2]
if not os.path.exists(OutDB):
DBpath = os.path.dirname(OutDB)
DBname = os.path.basename(OutDB)
name,ext = os.path.splitext(DBname)
if ext.upper() == ".MDB":
arcpy.AddMessage("Creating output personal database")
arcpy.CreatePersonalGDB_management(DBpath,DBname)
elif ext.upper() == ".GDB":
arcpy.AddMessage("Creating output file database")
arcpy.CreateFileGDB_management(DBpath,DBname)
else:
arcpy.AddError("Unknown output database format")
# set your workspace for ListDatasets
arcpy.env.workspace = InDB
# create empty lists
LineList = list()
PointList = list()
PolyList = list()
# Standalone feature classes
for FeatClass in arcpy.ListFeatureClasses():
desc = arcpy.Describe(InDB + "\\" + FC + "\\" + FeatClass)
if desc.shapeType == "Point":
PointList.append(InDB + "\\" + FC + "\\" + FeatClass)
elif desc.shapeType == "Polyline":
LineList.append(InDB + "\\" + FC + "\\" + FeatClass)
elif desc.shapeType == "Polygon":
PolyList.append(InDB + "\\" + FC + "\\" + FeatClass)
# iterate through feature datasets
for FC in arcpy.ListDatasets():
arcpy.env.workspace = InDB + "\\" + FC
for FeatClass in arcpy.ListFeatureClasses():
desc = arcpy.Describe(InDB + "\\" + FC + "\\" + FeatClass)
if desc.shapeType == "Point":
PointList.append(InDB + "\\" + FC + "\\" + FeatClass)
elif desc.shapeType == "Polyline":
LineList.append(InDB + "\\" + FC + "\\" + FeatClass)
elif desc.shapeType == "Polygon":
PolyList.append(InDB + "\\" + FC + "\\" + FeatClass)
arcpy.AddMessage("Performing merge")
if len(PointList) > 0:
arcpy.Merge_management(PointList,OutDB + "\\Merged_Points")
if len(LineList) > 0:
arcpy.Merge_management(LineList,OutDB + "\\Merged_Lines")
if len(PolyList) > 0:
arcpy.Merge_management(PolyList,OutDB + "\\Merged_Polygons")
If you replace arcpy.Merge_management
(smash a bunch together to a new feature class) with arcpy.Append_management
(insert a bunch of feature classes into an existing feature class) then it should do pretty much what you're after - if you do you will also need to change the output to the full path to the existing datasets to insert into.