[GIS] Clipping multipatch to polygon using ArcGIS for Desktop

arcgis-desktopclipmultipatchpolygon

I have a multipatch dataset and a 2d polygon.

Which ArcGIS geoprocessing tool can I use to select only those multipatches whoms x,y are inside the polygon?

I want to select all multipatch features that intersect if Z is disregarded.

Best Answer

The AOI tool solved the problem while in ArcScene http://resources.arcgis.com/en/help/main/10.1/index.html#//00q800000144000000

Another option is to use SelectLayerByLocation tool paired with CopyFeatures tool. I began coding this into a python toolbox:

def execute(self, parameters, messages):
    """The source code of the tool.  """
    # Get current extent
    mxd = arcpy.mapping.MapDocument("CURRENT")
    dataframe = arcpy.mapping.ListDataFrames(mxd)[0]
    ext = dataframe.extent      
    # Create BBOX feature
    feature_data = [[ext.XMin, ext.YMax], [ext.XMax, ext.YMax], [ext.XMax, ext.YMin], [ext.XMin,ext.YMin]]
    feature = arcpy.Polygon(arcpy.Array([arcpy.Point(*coords) for coords in feature_data]))
    # Create FeatureClass put features in it.
    arcpy.env.addOutputsToMap = 0       
    arcpy.CopyFeatures_management(feature, "H:/ArcGIS/temp_bbox.shp")               
    # First, make a layer from the feature class
    arcpy.MakeFeatureLayer_management("C:/temp/3Ddatabas/multipatchfixfull.gdb/ROOF_MULTIPATCH", "roof_layer")
    # Then add a selection to the layer based on location to features in another feature class 
    arcpy.SelectLayerByLocation_management ("roof_layer", "intersect", "H:/ArcGIS/temp_bbox.shp")
    arcpy.env.addOutputsToMap = 1
    import time
    t = int(time.time())
    arcpy.CopyFeatures_management('roof_layer', 'C:/temp/3Ddatabas/dev1.gdb/ROOF_selected_' + `t`)      
    #Clean up
    arcpy.Delete_management("H:/ArcGIS/temp_bbox.shp")
    arcpy.Delete_management("roof_layer")
    return