Skip To Content

Enclose Multipatch

Summary

Creates closed multipatch features from open multipatch features.

Usage

  • This tool is designed for multipatch features that have an opening along the lower portions of the geometry. The enclosed output will drape along the input feature and obscure any overhangs that may be present in the input feature.

  • All multipatch features will be evaluated to determine which ones are closed. Features that are already closed will be copied to the output multipatch without any modification. The Is Closed 3D tool can be used to quickly determine whether any unclosed multipatch features exist in the input feature class.

Syntax

EncloseMultiPatch_3d (in_features, out_feature_class, {grid_size})
ParameterExplanationData Type
in_features

The multipatch features that will be used to construct closed multipatches.

Feature Layer
out_feature_class

The output closed multipatch features.

Feature Class
grid_size
(Optional)

The resolution that will be used to construct the closed multipatch features. This value is defined using the linear units of the input feature's spatial reference.

Double

Code sample

EncloseMultiPatch example 1 (Python window)

The following sample demonstrates the use of this tool in the Python window.

arcpy.env.workspace = 'C:/data'
arcpy.EncloseMultiPatch_3d('unclosed_features.shp',
                          'enclosed_features.shp', 0.5)
EncloseMultiPatch example 2 (stand-alone script)

The following sample demonstrates the use of this tool in a stand-alone Python script.

'''*********************************************************************
Name: Model Shadows For GeoVRML Models
Description: Creates a model of the shadows cast by GeoVRML models
             imported to a multipatch feature class for a range of dates
             and times. A range of times from the start time and end
             time can also be specified by setting the EnforceTimes
             Boolean to True. This sample is designed to be used in a
             script tool.
*********************************************************************'''
# Import system modules
import arcpy
from datetime import datetime, time, timedelta

#*************************  Script Variables  **************************
inFiles = arcpy.GetParameterAsText(0) # list of input features
spatialRef = arcpy.GetParameterAsText(1) # list of GeoVRML files
outFC = arcpy.GetParameterAsText(2) # multipatch from 3D files
inTimeZone = arcpy.GetParameterAsText(3) # time zone
startDate = arcpy.GetParameter(4) # starting date as datetime
endDate = arcpy.GetParameter(5) # ending date as datetime
dayInterval = arcpy.GetParameter(6) # day interval as long (0-365)
minInterval = arcpy.GetParameter(7) # minute interval as long (0-60)
enforceTime = arcpy.GetParameter(8) # minute interval as Boolean
outShadows = arcpy.GetParameterAsText(9) # output shadow models
outIntersection = arcpy.GetParameterAsText(10) # shadow & bldg intersection

# Function to find all possible date/time intervals for shadow modelling
def time_list():
    dt_result = [startDate]
    if dayInterval:
        if endDate: #Defines behavior when end date is supplied
            while startDate < endDate:
                startDate += timedelta(days=dayInterval)
                dt_result.append(startDate)
            dt_result.append(endDate)
        else: # Behavior when end date is not given
            daymonthyear = datetime.date(startDate)
            while startDate <= datetime(daymonthyear.year, 12, 31, 23, 59):
                startDate += timedelta(days=dayInterval)
                dt_result.append(startDate)
    return dt_result


importFC = arcpy.CreateUniqueName('geovrml_import', 'in_memory')

# Import GeoVRML files to in-memory feature
arcpy.ddd.Import3DFiles(inFiles, importFC, 'ONE_FILE_ONE_FEATURE',
                        spatialRef, 'Z_IS_UP', 'wrl')

# Ensure that building models are closed
arcpy.ddd.EncloseMultiPatch(importFC, outFC, 0.05)

# Discard in-memory feature
arcpy.management.Delete(importFC)
dt_result = time_list()
for dt in dt_result:
    if dt == dt_result[0]:
        shadows = outShadows
    else:
        shadows = arcpy.CreateUniqueName('shadow', 'in_memory')
    arcpy.ddd.SunShadowVolume(outFC, dt, shadows, 'ADJUST_FOR_DST',
                              inTimeZone, '', minInterval, 'MINUTES')
    if dt is not dt_result[0]:
        arcpy.management.Append(shadows, outShadows)
        arcpy.management.Delete(shadows)
arcpy.ddd.Intersect3D(outFC, outIntersection, outShadows, 'SOLID')

Licensing information

  • ArcGIS Desktop Basic: Requires 3D Analyst
  • ArcGIS Desktop Standard: Requires 3D Analyst
  • ArcGIS Desktop Advanced: Requires 3D Analyst

Related topics