# Name: Indoors_GenerateOccupantFeatures_example2.py
# Description: Imports occupant information from an Excel spreadsheet to a
# point feature class in an indoor dataset or Indoors geodatabase.
import arcpy
# Use the Units feature class in the indoor dataset or Indoors geodatabase as the input unit features
in_unit_features = 'C:/Indoors/ExampleCampus.gdb/Indoor/Units'
# The join will use the NAME field from Units feature class
unit_id_field = 'NAME'
# Use an Excel spreadsheet as the input occupant table
in_occupant_table = r'C:\Indoors\EmployeeInfo.xls\MarketingDept$'
# The spreadsheet's OFFICE column has values that match those in Units' NAME field
occupant_id_field = 'OFFICE'
# Output Occupants feature class
out_occupant_feature_class = 'C:/Indoors/ExampleCampus.gdb/Indoor/Occupants'
# Execute GenerateOccupantFeatures
arcpy.indoors.GenerateOccupantFeatures(in_unit_features, unit_id_field,
in_occupant_table, occupant_id_field,
out_occupant_feature_class)