Multipatch To Collada (Conversion)


Converts one or more multipatch features into a collection of COLLADA files and referenced texture image files in an output folder. The inputs can be a layer or a feature class.



MultipatchToCollada_conversion (in_features, output_folder, {prepend_source}, field_name)
ParameterExplanationData Type

The multipatch features to be exported.

Feature Layer

The destination folder where the output COLLADA files and texture image files will be placed.


Prepend the file names of the output COLLADA files with the name of the source feature layer.

  • PREPEND_SOURCE_NAMEPrepend the file names.
  • PREPEND_NONEDo not prepend the file names. This is the default.

The feature attribute to use as the output COLLADA filename for each exported feature. If no field is specified, the feature's Object ID is used.


Code Sample

MultipatchToCollada Example (Python Window)

The following Python window script demonstrates how to use the MultipatchToCollada function in immediate mode.

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.MultipatchToCollada_conversion("Buildings","C:/COLLADA", PREPEND_SOURCE_NAME, "BldName")
MultipatchToCollada Example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the MultipatchToCollada function.

# Name:
# Description: The following stand-alone script demonstrates how to use the
# 			MultipatchToCollada tool to convert all multipatch shapefiles 
#			in a target workspace.
# Requirements: 3D Analyst extension
# Author: ESRI

# Import system modules
import arcpy
from arcpy import env

# Obtain a license for the 3D Analyst extension

# Set environment settings
env.workspace = "C:/data"

    # Create list of feature classes in workspace
    fcList = arcpy.ListFeatureClasses()
    # Determine if the list contained any feature classes
    if len(fcList) > 0:
        # Iterate through each feature class
        for fc in fcList:
            # Describe the feature class
            desc = arcpy.Describe(fc)
            # Determine if feature class is a multipatch
            if desc.shapeType is "MultiPatch":
                # Set Local Variables
                ## Ensure unique name for output folder
                outDir = arcpy.CreateUniqueName("collada_dir")
                ## Specify that collada file is prefixed by source name 
                prepend = "PREPEND_SOURCE_NAME"
                ## Specify the feature attribute used to name Collada files
                fldName = "Name"
                #Execute MultipatchToCollada
                arcpy.MultipatchToCollada(fc, outDir, prepend, fldName)
                del outDir, prepend, fldName
                print "There are no multipatch shapefiles in " + env.workspace + "."
        print "There are no feature classes in " + env.workspace + "."

except Exception as e:
    # Returns any other error messages
    print arcpy.GetMessages(2)

del arcpy


This tool does not use any geoprocessing environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes