3D ファイルのインポート(Import 3D Files) (3D Analyst)
サマリ
1 つ以上の 3D モデルをマルチパッチ フィーチャクラスにインポートします。
使用法
- 
このツールは、3D Studio Max(*.3ds)、VRML および GeoVRML 2.0(*.wrl)、SketchUp 6.0(*.skp)、OpenFlight 15.8(*.flt)、COLLADA(*.dae)をサポートしています。 
- 
出力マルチパッチをジオデータベースに格納することによって、テクスチャ処理された画像を 3D モデルで保持します。シェープファイルはテクスチャの保持をサポートしていません。 
- 
生成されたマルチパッチ フィーチャの上部が横向きになっている場合は、[Y_Is_Up] パラメータを有効にしてこのツールをもう一度使用し、向きを調整します。 
- 
定義された座標系を持つ形式は、GeoVRML のみです。多くの 3D モデルが、0,0,0 の XYZ 軸を中心とするローカル座標系を使用して生成されます。このようなフィーチャは、次のいずれかの方法を使用して、実世界の座標系にジオリファレンスできます。 - 3D モデルを回転および移動する必要がある場合は、アジャスト手法を実行して、フィーチャを正しく配置することを検討してください。
- 指定された座標系で 3D モデルが正しい方向に配置されており、正しい位置に移動するだけでよい場合は、[座標系] プロパティをカスタマイズして必要な移動を実行することを検討してください。実世界の座標系で各モデルの重心の位置を定義するポイント フィーチャが存在する場合は、ツールの入力としてポイントを使用して、モデルをジオリファレンスすることを検討してください。
 
- 
3D ファイル内にポイントおよびライン ジオメトリが存在していても、出力マルチパッチ フィーチャクラスでは維持されません。マルチパッチがこれらをサポートしていないからです。  注意: 注意:VRML ファイルでサポートされていないジオメトリ タイプには、箱、円錐体、円柱、立ち上げ、ポイントセット、球体、テキストなどがあります。 
構文
| パラメータ | 説明 | データ タイプ | 
| in_files | サポートされている形式のファイルを含む 1 つ以上の 3D モデルまたはフォルダ。サポートされている形式は、3D Studio Max(*.3ds)、SketchUp(*.skp)、VRML および GeoVRML(*.wrl)、OpenFlight(*.flt)、COLLADA(*.dae)です。 | File; Folder | 
| out_featureClass | 入力ファイルから作成されるマルチパッチ。 | Feature Class | 
| root_per_feature (オプション) | ファイルごとに 1 つのフィーチャを作成するのか、ファイル内のルート ノードごとに 1 つのフィーチャを作成するのかを示します。このオプションの適用対象は VRML モデルだけです。 
 | Boolean | 
| spatial_reference (オプション) | 入力データの座標系です。大部分の形式で、これは不明になります。GeoVRML 形式のみがその座標系を格納します。そのデフォルトは(空間参照がここで指定されていなければ)、リストの 1 つ目のファイルから取得されます。 | Spatial Reference | 
| y_is_up (オプション) | 入力ファイルの縦方向を定義する軸を識別します。 
 | Boolean | 
| file_suffix | 入力フォルダからインポートするファイルのファイル拡張子。少なくとも 1 つのフォルダが入力として指定されている場合は、このパラメータが必要です。 
 | String | 
| in_featureClass (オプション) | 座標が入力ファイルの実世界の位置を定義するポイント フィーチャ。各入力ファイルが [シンボル フィールド] に格納されているファイル名に基づいて対応するポイントに対応付けられます。ポイントの空間参照を対応付けるには、[座標系] パラメータを定義する必要があります。 | Feature Class | 
| symbol_field (オプション) | 各ポイントに関連付けられている 3D ファイルの名前を含んでいるポイント フィーチャのフィールド。 | Field | 
コードのサンプル
次のサンプルは、Python ウィンドウでこのツールを使用する方法を示しています。
import arcpy
from arcpy import env
arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.Import3DFiles_3d("AddisSheraton.skp", "Test.gdb/AddisSheraton", False, "", False)
次のサンプルは、スタンドアロン Python スクリプトでこのツールを使用する方法を示しています。
'''*********************************************************************
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
try:
    arcpy.CheckOutExtension('3D')
    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')
    arcpy.CheckInExtension('3D')
except arcpy.ExecuteError:
    print arcpy.GetMessages()
except:
    # Get the traceback object
    tb = sys.exc_info()[2]
    tbinfo = traceback.format_tb(tb)[0]
    # Concatenate error information into message string
    pymsg = "PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}"\
          .format(tbinfo, str(sys.exc_info()[1]))
    msgs = "ArcPy ERRORS:\n {0}\n".format(arcpy.GetMessages(2))
    # Return python error messages for script tool or Python Window
    arcpy.AddError(pymsg)
    arcpy.AddError(msgs)