Import CAD To Indoor Dataset (Indoors)

Available with the ArcGIS Indoors Pro or ArcGIS Indoors Maps extension.

Summary

Imports features from a CAD file into an indoor dataset that conforms to the ArcGIS Indoors Information Model. The output of this tool can be used to create floor-aware maps and scenes, as well as to generate an indoor network for routing.

Usage

  • Use this tool to load floor plan data into an Indoors workspace created using the Create Indoor Dataset tool or the Create Indoors Database tool.

  • The Source CAD Data parameter value must be a .dwg or .dgn file.

  • The source CAD data must be georeferenced before running the tool.

  • The Target Unit Features, Target Level Features, Target Facility Features, and Target Detail Features parameters must reference feature classes or feature layers that conform to the Indoors model.

    Note:

    The target features must all be from the same file geodatabase, enterprise geodatabase, or feature service.

  • Set the name of the level for the Level Name parameter. If the level exists in the target Levels layer, you can choose it from the drop-down list. If you choose an existing Levels layer, the Levels feature and associated Units and Details features will be updated. Field values from fields in the Levels and Units layers that are not populated by default will be preserved if they are not mapped using the CAD Annotation Mapping parameter. Details features will be deleted and overwritten.

  • You can import features from CAD layers in the input CAD file, or add the CAD file to a map and import features from the polyline layers. Use the Select Layer From Source CAD parameter to specify whether to import from CAD input layers or from map polyline layers.

    • If the Select Layer From Source CAD parameter is checked, provide CAD layers for the Source CAD Layers for Units, Source CAD Layers for Levels, Source CAD Layers for Details, and Source CAD Layers for Facilities parameters. Optionally, include door entities in the Source CAD Layers for Doors parameter.
    • If the Select Layer From Source CAD parameter is unchecked, provide CAD polyline map layers for the Source Layers For Units, Source Layers For Levels, Source Layers For Details, and Source Layers For Facilities parameters. Optionally, include door entities in the Source Layers For Doors parameter. Selections on input map layers are honored.
  • Provide the polyline layers that represent unit boundaries for the Source CAD Layers for Units or Source Layers for Units parameters. This may include a single layer that represents room boundaries, or multiple layers that, when combined, represent room boundaries (such as layers for exterior walls, interior walls, and doors).

  • Provide the polyline layers that represent level boundaries for the Source CAD Layers for Levels or Source Layers for Levels parameters.

    If no value is provided for either parameter, the tool will create a level polygon feature based on the extent of the unit polygons.

  • Set the Level Elevation parameter value as the elevation of the level in relation to the ground. The parameter value must include a numeric value and a unit of measure (international feet or meters). Z-values for levels, units, and details are populated based on this value.

  • Provide an ordinal integer representing the vertical order of each floor for the Vertical Order parameter value. The vertical order of the ground floor is zero (0). Floors above the ground floor have positive vertical order values, and floors below the ground floor have negative values.

  • Provide the polyline layers that represent facility boundaries for the Source CAD Layers for Facilites or Source Layers for Facilities parameters.

    If no value is provided for either parameter, the tool will create or update the facility polygon based on the extent of all the level polygons in the facility.

  • Provide the polyline layers that represent features you want to import as polyline features in the details layer (such as walls, windows, doors, furniture, and so on) for the Source CAD Layers for Details or Source Layers for Details parameters.

  • If the input CAD data contains door features that must be closed to create unit, level, or facility boundaries, use the following parameters to close doors:

    • For the Source CAD Layers For Doors or Source Layers For Doors parameters, provide the CAD or map layers that contain door features.
    • Optionally, set a value for the Door To Wall Distance parameter. The parameter value indicates the distance the tool searches from the door feature for the wall feature of the related unit. The parameter value must include a numeric value and a unit of measure (international inches or millimeters). The default is 0.3 international inches.
  • Use the CAD Annotation Mapping parameter to map CAD annotation to features in the Indoors model. At a minimum, it is recommended that you map information from CAD to the NAME and USE_TYPE fields in the Units layer. These field values are used to enable functionality in ArcGIS Pro and the Indoors web and mobile apps. The NAME field is also used in update scenarios when rerunning the tool to update features in the Indoors workspace.

    Set the values as follows:

    • Target Indoor Layer—Specify the layer in the Indoors workspace to which you want to map annotation. You can set Units, Levels, or Facilities as inputs to this value, which correspond to the parameter values provided for the Target Unit Features, Target Level Features, and Target Facility Features parameters. Mapping annotation to the Details layer is not supported.
    • Target Field—Provide the field from the target indoor layer to which you want to map CAD annotation.
    • Entity Type—Specify the entity type (Text or Block) of the CAD annotation you are mapping. If the CAD annotation is Text or MText in the source CAD file, choose Text. If the CAD annotation is stored as block annotation, choose Block.
    • Source CAD Layer—Provide the CAD layer that contains the CAD annotation you want to map.
    • Block Attribute—If you set the Entity Type value to Block, provide the name of the block attribute where the CAD annotation you want to map to the target field is stored. If you set the Entity Type value to Text, do not provide a value.
    • Delimeter—If the value you want to map to the target field is stored as delimited text, set the delimiter for this value. For example, if you have period-delimited CAD annotation such as CAMPUS.A.A-210 and you want to map the third part of the string (A-210) as the UNIT_NAME field value, use the period (.) as the Delimeter value.
    • Position—If the value you want to map to the target field is stored as delimited text, set the position of the value you want to map in which the beginning of the string is position 1. For example, if you have period-delimited CAD annotation such as CAMPUS.A.A-210 and you want to map the third part of the string (A-210) as the UNIT_NAME field value, use 3 as the Position value.
    Note:

    When targeting the Units feature class, if the CAD annotation is sourced from multiple CAD layers, you can provide multiple inputs to the CAD Annotation Mapping parameter targeting the same field. If more than one of the specified CAD layers contain annotations for a unit feature, the tool uses the CAD annotation from the first CAD layer provided it contains annotation for the feature.

  • The Minimum Unit Width parameter indicates the smallest width a polygon must have to be considered a unit feature. The parameter value must include a numeric value and a unit of measure (international feet or meters). The default is 3 international feet.

  • The Minimum Unit Area parameter indicates the smallest area a polygon must have to be considered a unit feature. The parameter value must include a numeric value and a unit of measure (square international feet or square meters). The default is 9 square international feet.

  • Any polygons that do not meet the thresholds set by the Minimum Unit Width or Minimum Unit Area parameters are copied to a scratch feature class in the default geodatabase of the ArcGIS Pro project. You can inspect the scratch feature class polygons and append any of them to the Units layer as needed.

  • If a level feature exists with the same name as the Level Name parameter value, the level and its associated units and details features will be updated as follows:

    • The levels feature will be updated. Any attributes that are not populated by default, including custom fields, will be preserved.
    • The tool will compare unit features between the CAD drawing and the Units layer. If units with matching names or geometry are found, they will be updated. Any fields the tool does not populate by default that are not mapped using the CAD Annotation Mapping parameter will be preserved. Features that are present in the CAD drawing but not in the Units layer will be added. Features that are not present in the CAD drawing but are present in the Units layer will be deleted.
    • Details features will be deleted and reimported from the CAD drawing.
    • If map layers are provided as the inputs for units and details, the tool will only update the selected area of the level.
    Note:

    If the Level Name parameter value does not match the NAME field for an existing level feature, the tool imports the CAD drawing as a new level with the specified Level Name value.

Parameters

LabelExplanationData Type
Source CAD Data

The .dwg or .dgn file that contains floor plan information to be imported to the Indoors model.

CAD Drawing Dataset
Target Level Features

The target Levels feature layer, feature class, or feature service that conforms to the ArcGIS Indoors Information Model and resides in the same workspace as the target Facilities, Units, and Details features.

Feature Layer
Level Name

The unique level name of the level on which the source CAD data is located.

String
Vertical Order

An ordinal integer representing the vertical order of each floor. The vertical order of the ground floor is zero (0). Floors above the ground floor have positive vertical order values, and floors below the ground floor have negative values.

Long
Elevation Of Level

The elevation of the level relative to a flat terrain. This value will be used to populate the z-value for levels, units, and details.

Linear Unit
Target Facility Features

The target Facilities feature layer, feature class, or feature service that conforms to the ArcGIS Indoors Information Model and resides in the same workspace as the target Levels, Units, and Details features.

Feature Layer
Facility Name

The unique facility name of the building in which the source CAD data is located.

String
Target Unit Features

The target Units feature layer, feature class, or feature service that conforms to the ArcGIS Indoors Information Model and resides in the same workspace as the target Facilities, Levels, and Details features.

Feature Layer
Target Detail Features

The target Details feature layer, feature class, or feature service that conforms to the ArcGIS Indoors Information Model and resides in the same workspace as the target Facilities, Levels, and Units features.

Feature Layer
Select Layer From Source CAD
(Optional)

Specifies whether polylines that represent unit boundaries will be sourced from the CAD file or from map feature layers. If you specify to select based on map feature layers, you can make a selection on the layer to import a subset of features.

  • Checked—Polylines that represent unit boundaries will be sourced directly from the CAD file. This is the default.
  • Unchecked—Polylines that represent unit boundaries will be sourced from map feature layers.
Boolean
Source CAD Layers For Units
(Optional)

The CAD layers that contain polyline entities that define the edges and extent of the usable spaces within a facility. These polylines will be used to create unit polygon features in the target Units layer.

String
Source Layers For Units
(Optional)

The feature layers that contain polyline entities that define the edges and extent of the usable spaces within a facility. These polylines will be used to create unit polygon features in the target Units layer.

Feature Layer
Source CAD Layers For Levels
(Optional)

The CAD layers that contain polyline entities that define the edges and extent of the level. These polylines will be used to create unit polygon features in the target Levels layer.

String
Source Layers For Levels
(Optional)

The feature layers that contain polyline entities that define the edges and extent of the level. These polylines will be used to create unit polygon features in the target Levels layer.

Feature Layer
Source CAD Layers For Doors
(Optional)

The CAD layers that contain polyline entities that define the doors that are part of a unit boundary. These polylines will be closed to create unit polygon features in the target Units layer.

String
Source Layers For Doors
(Optional)

The feature layers that contain polyline entities that define the doors that are part of a unit boundary. These polylines will be closed to create unit polygon features in the target Units layer.

Feature Layer
Source CAD Layers For Details
(Optional)

The CAD layers that contain polyline entities that represent floor plan details—such as walls, windows, and doors—that will be included as polyline features in the target Details layer.

String
Source Layers For Details
(Optional)

The CAD layers that contain polyline entities that represent floor plan details—such as walls, windows, and doors—that will be included as polyline features in the target Details layer.

Feature Layer
Source CAD Layers For Facilities
(Optional)

The CAD layers that contain polyline entities that define the edges and extent of the facility footprint. If no value is provided, the facility footprint will be created or updated based on the extent of all levels within the facility.

String
Source Layers For Facilities
(Optional)

The feature layers that contain polyline entities that define the edges and extent of the facility footprint. If no value is provided, the facility footprint will be created or updated based on the extent of all levels within the facility.

Feature Layer
CAD Annotation Mapping
(Optional)

Specifies field mapping for CAD annotation features to populate a field of a layer in the Indoors workspace.

  • Target Indoor Layer—The layer in the Indoors workspace to which you want to map annotation. The tool supports mapping to the layer provided for the Target Facilities, Target Levels, and Target Units parameters.
  • Target Field—The field in the target layer to which you want to map annotation. The field must already exist.
  • Entity Type—The entity type of the annotation you want to map. Text and Block types are supported.
  • Source CAD Layer—The CAD layer that contains the annotation that will be mapped.
  • Block Attribute—For annotation that has the block entity type, provide the block attribute that contains the information to map.
  • Delimiter—For annotation stored in a delimited string, provide the delimiting character.
  • Position—For annotation stored in a delimited string, provide the position of the value to map.

Value Table
Door To Wall Distance
(Optional)

The distance the tool will search from a door feature for a unit boundary in international inches or millimeters. The default is 0.3 international inches.

Linear Unit
Minimum Unit Width
(Optional)

The minimum width in international feet or meters a space must be to be considered a unit feature. Features with a width that falls below this threshold will be written to a nonunit polygons feature class and are not included in the target Units layer. The default is 3 international feet.

Linear Unit
Minimum Unit Area
(Optional)

The minimum area in square international feet or square meters a space must be to be considered a unit feature. Features with an area that falls below this threshold will be written to a nonunit polygons feature class and are not included in the target Units layer. The default is 9 square international feet.

Areal Unit

Derived Output

LabelExplanationData Type
Updated Units

The updated target unit features.

Feature Layer

arcpy.indoors.ImportCADToIndoorDataset(input_cad_datasets, target_level_features, level_name, vertical_order, level_elevation, target_facility_features, facility_name, target_unit_features, target_detail_features, {allow_layers_from_cad}, {input_unit_layers_cad}, {input_unit_feature_layers}, {input_level_layers_cad}, {input_level_feature_layers}, {input_door_layers_cad}, {input_door_feature_layers}, {input_detail_layers_cad}, {input_detail_feature_layers}, {input_facility_layers_cad}, {input_facility_feature_layers}, {cad_annotation_mapping}, {door_close_buffer}, {input_unit_minimum_width}, {input_unit_minimum_area})
NameExplanationData Type
input_cad_datasets

The .dwg or .dgn file that contains floor plan information to be imported to the Indoors model.

CAD Drawing Dataset
target_level_features

The target Levels feature layer, feature class, or feature service that conforms to the ArcGIS Indoors Information Model and resides in the same workspace as the target Facilities, Units, and Details features.

Feature Layer
level_name

The unique level name of the level on which the source CAD data is located.

String
vertical_order

An ordinal integer representing the vertical order of each floor. The vertical order of the ground floor is zero (0). Floors above the ground floor have positive vertical order values, and floors below the ground floor have negative values.

Long
level_elevation

The elevation of the level relative to a flat terrain. This value will be used to populate the z-value for levels, units, and details.

Linear Unit
target_facility_features

The target Facilities feature layer, feature class, or feature service that conforms to the ArcGIS Indoors Information Model and resides in the same workspace as the target Levels, Units, and Details features.

Feature Layer
facility_name

The unique facility name of the building in which the source CAD data is located.

String
target_unit_features

The target Units feature layer, feature class, or feature service that conforms to the ArcGIS Indoors Information Model and resides in the same workspace as the target Facilities, Levels, and Details features.

Feature Layer
target_detail_features

The target Details feature layer, feature class, or feature service that conforms to the ArcGIS Indoors Information Model and resides in the same workspace as the target Facilities, Levels, and Units features.

Feature Layer
allow_layers_from_cad
(Optional)

Specifies whether polylines that represent unit boundaries will be sourced from the CAD file or from map feature layers. If you specify to select based on map feature layers, you can make a selection on the layer to import a subset of features.

  • ALLOW_LAYERS_FROM_CADPolylines that represent unit boundaries will be sourced directly from the CAD file. This is the default.
  • NO_ALLOW_LAYERS_FROM_CADPolylines that represent unit boundaries will be sourced from map feature layers.
Boolean
input_unit_layers_cad
[input_unit_layers_cad,...]
(Optional)

The CAD layers that contain polyline entities that define the edges and extent of the usable spaces within a facility. These polylines will be used to create unit polygon features in the target Units layer.

String
input_unit_feature_layers
[input_unit_feature_layers,...]
(Optional)

The feature layers that contain polyline entities that define the edges and extent of the usable spaces within a facility. These polylines will be used to create unit polygon features in the target Units layer.

Feature Layer
input_level_layers_cad
[input_level_layers_cad,...]
(Optional)

The CAD layers that contain polyline entities that define the edges and extent of the level. These polylines will be used to create unit polygon features in the target Levels layer.

String
input_level_feature_layers
[input_level_feature_layers,...]
(Optional)

The feature layers that contain polyline entities that define the edges and extent of the level. These polylines will be used to create unit polygon features in the target Levels layer.

Feature Layer
input_door_layers_cad
[input_door_layers_cad,...]
(Optional)

The CAD layers that contain polyline entities that define the doors that are part of a unit boundary. These polylines will be closed to create unit polygon features in the target Units layer.

String
input_door_feature_layers
[input_door_feature_layers,...]
(Optional)

The feature layers that contain polyline entities that define the doors that are part of a unit boundary. These polylines will be closed to create unit polygon features in the target Units layer.

Feature Layer
input_detail_layers_cad
[input_detail_layers_cad,...]
(Optional)

The CAD layers that contain polyline entities that represent floor plan details—such as walls, windows, and doors—that will be included as polyline features in the target Details layer.

String
input_detail_feature_layers
[input_detail_feature_layers,...]
(Optional)

The CAD layers that contain polyline entities that represent floor plan details—such as walls, windows, and doors—that will be included as polyline features in the target Details layer.

Feature Layer
input_facility_layers_cad
[input_facility_layers_cad,...]
(Optional)

The CAD layers that contain polyline entities that define the edges and extent of the facility footprint. If no value is provided, the facility footprint will be created or updated based on the extent of all levels within the facility.

String
input_facility_feature_layers
[input_facility_feature_layers,...]
(Optional)

The feature layers that contain polyline entities that define the edges and extent of the facility footprint. If no value is provided, the facility footprint will be created or updated based on the extent of all levels within the facility.

Feature Layer
cad_annotation_mapping
[cad_annotation_mapping,...]
(Optional)

Specifies field mapping for CAD annotation features to populate a field of a layer in the Indoors workspace.

  • Target Indoor Layer—The layer in the Indoors workspace to which you want to map annotation. The tool supports mapping to the layer provided for the Target Facilities, Target Levels, and Target Units parameters.
  • Target Field—The field in the target layer to which you want to map annotation. The field must already exist.
  • Entity Type—The entity type of the annotation you want to map. Text and Block types are supported.
  • Source CAD Layer—The CAD layer that contains the annotation that will be mapped.
  • Block Attribute—For annotation that has the block entity type, provide the block attribute that contains the information to map.
  • Delimiter—For annotation stored in a delimited string, provide the delimiting character.
  • Position—For annotation stored in a delimited string, provide the position of the value to map.

Value Table
door_close_buffer
(Optional)

The distance the tool will search from a door feature for a unit boundary in international inches or millimeters. The parameter value must include a numeric value and a unit of measure. The default is 0.3 international inches.

Linear Unit
input_unit_minimum_width
(Optional)

The minimum width in international feet or meters that a space must be to be considered a unit feature. Features with a width that falls below this threshold will be written to a nonunit polygons feature class and are not included in the target Units layer. The parameter value must include a numeric value and a unit of measure. The default is 3 international feet.

Linear Unit
input_unit_minimum_area
(Optional)

The minimum area in square international feet or square meters a space must be to be considered a unit feature. Features with an area that falls below this threshold will be written to a nonunit polygons feature class and are not included in the target Units layer. The parameter value must include a numeric value and a unit of measure. The default is 9 square international feet.

Areal Unit

Derived Output

NameExplanationData Type
updated_units

The updated target unit features.

Feature Layer

Code sample

ImportCADToIndoorDataset example 1 (Python window)

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

import arcpy
arcpy.indoors.ImportCADToIndoorDataset('C:/Indoors/Building_H/Bldg_H_1.dwg', 'C:/Indoors/ExampleCampus.gdb/Indoor/Levels', 'H1', '0',
                                       "0 Meters", 'C:/Indoors/ExampleCampus.gdb/Indoor/Facilities', 'Building H', 
                                       'C:/Indoors/ExampleCampus.gdb/Indoor/Units', 'C:/Indoors/ExampleCampus.gdb/Indoor/Details',
                                       'ALLOW_LAYERS_FROM_CAD', 'A-ROOMS', '',
                                       'A-FLOOR-OUTLINE', '',
                                       '', '',
                                       '','',
                                       'Units NAME Text A-AREA-IDEN # # #;Units USE_TYPE Text A-AREA-TYPE # # #', '',
                                       '0.455 Meters', '0.4 SquareMeters')
ImportCADToIndoorDataset example 2 (stand-alone script)

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

import arcpy

#Set the CAD dataset to import
input_cad_datasets = 'C:/Indoors/Building_H/Bldg_H_2.dwg'

#Set target layers that conform to the ArcGIS Indoors Information model
target_unit_features = 'C:/Indoors/ExampleCampus.gdb/Indoor/Units'
target_detail_features = 'C:/Indoors/ExampleCampus.gdb/Indoor/Details'
target_level_features = 'C:/Indoors/ExampleCampus.gdb/Indoor/Levels'
target_facility_features = 'C:/Indoors/ExampleCampus.gdb/Indoor/Facilities'

#Set the level information
level_name = "H2"
vertical_order = 1
level_information = "8 FeetInt"

#Set the facility name
facility_name = "Building H"

# Choose to import CAD layers added to a map, 
# create the map layers from polyline features in CAD
allow_layers_from_cad = "NO_ALLOW_LAYERS_FROM_CAD"
input_unit_layers_cad = ''
in_CAD_fc = "C:/Indoors/Building_H/Bldg_H_2.dwg/Polyline"
input_unit_feature_layers = arcpy.management.MakeFeatureLayer(in_CAD_fc, 'units_feature_layer', "Layer IN('A-DOOR', 'A-WALL', 'I-WALL')") 
input_level_layers_cad = ''
input_level_feature_layers = arcpy.management.MakeFeatureLayer(in_CAD_fc, 'level_feature_layer', "Layer = 'A-FLOOR-OUTLINE'")
input_facility_layers_cad = ''
input_facility_feature_layers = arcpy.management.MakeFeatureLayer(in_CAD_fc, 'facility_feature_layer', "Layer = 'A-BLDG-OUTLINE'")
input_door_layers_cad = ''
input_door_feature_layers = arcpy.management.MakeFeatureLayer(in_CAD_fc, 'level_feature_layer', "Layer = 'A-DOOR'")

#Map CAD annotation
cad_annotation_mapping = 'Units NAME Text A-AREA-IDEN # # #;'\
                         'Units USE_TYPE Block A-ROOM-INFO ROOMUSE # #;'\
                         'Facilities NAME_LONG Text A-BLDG-INFO # . 2'

# Set the minimum width and area that should be considered a unit feature
door_close_buffer = ''
input_unit_minimum_width = ""
input_unit_minimum_area = ""

# Run the tool
arcpy.indoors.ImportCADToIndoorDataset(input_cad_datasets, target_level_features, level_name, vertical_order,
                                       level_elevation, target_facility_features, facility_name, target_unit_features,
                                       target_detail_features, allow_layers_from_cad, 
                                       input_unit_layers_cad, input_unit_feature_layers,
                                       input_level_layers_cad, input_level_feature_layers,
                                       input_door_layers_cad, input_door_feature_layers,
                                       input_facility_layers_cad, input_facility_feature_layers,
                                       cad_annotation_mapping, door_close_buffer,
                                       input_unit_minimum_width, input_unit_minimum_area)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: No
  • Advanced: Requires ArcGIS Indoors Pro or ArcGIS Indoors Maps

Related topics