Create UIC Building Data Details
The CreateUICBuildingData function processes a building floor plan (AutoCAD .dwg/.dxf file) and cross-references it with room and department spreadsheets. It is used to either generate a detailed space inventory JSON file or colorize room polygons by department with an embedded legend directly in the output drawing.
1. Required Spreadsheets / Data Files
To run this process, three files must exist in the same directory as the input CSV/XLSX:
A. Room Attributes Spreadsheet (The Primary Data Source)
- Default Name: Typically
dwg_room_attr_with_dp_names.csv(or.xlsx/.xls). - Purpose: Associates each physical room ID on the drawing with building, floor, department, division, category, type, and area info.
- Expected Columns (15 Columns):
dwgname: Drawing/Floor identifier (must matchS<BuildingName>-<Floor>e.g.,SB-L03).bl_id: Building ID.fl_id: Floor ID.rm_id: Room ID (matches room numbers on the drawing).rm_cat: Room Category code.rm_type: Room Type code.area: Room area.dp_id: Department ID.dp_name: Department Name.dv_id: Division ID.org_campus_id: Campus Identifier.org_admin_id: Administrative Identifier.bu_id: Business Unit ID.org_school_id: School Identifier.org_dv_id: Organizational Division ID.
B. Room Category and Room Type Mapping
- File Name:
rmcat and rmtype.csv(or.xlsx/.xlsif Excel support is enabled). - Purpose: Maps short codes (e.g., room category
OFFICE, room typeOFF-EXEC) to human-readable names (e.g.,"Office Space","Executive Office"). - Expected Structure:
- CSV Columns:
rm_cat,rm_cat_desc,rm_type,rm_type_desc. - Excel Sheet: Expects a worksheet named
"SQLT0009"with columns representing Category Code, Category Description, Type Code, and Type Description.
- CSV Columns:
C. Department Hex Color Code Spreadsheet
- File Name:
dp_colors_with_hex.xlsx - Purpose: Defines colors for color-coding rooms by department on the drawing.
- Expected Structure:
- Excel Sheet: Must contain a worksheet named
"SQLT0115". - Columns:
- Department ID (
DPID) - Division ID (
DVID) - Pattern type (unused/ignored)
- Hex Color (
HexColor, e.g.,FF0000or#FF0000).
- Department ID (
- Excel Sheet: Must contain a worksheet named
2. Configuration Parameters & Controls
These command-line switches and parameters alter the behavior and output of the processing run:
Mode Selection (JSON vs. DWG Output)
- Detailed JSON Mode: When enabled, the program outputs a
<OutputName>_detailed.jsoncontaining metadata (categories, types, department names, campus/admin IDs) for all matched rooms. No visual drawing hatches are generated. - Drawing Colorization Mode: When detailed JSON output is disabled, the program modifies the AutoCAD drawing database directly:
- Generates solid color department hatches inside room boundaries using the hex colors defined in
dp_colors_with_hex.xlsx. - Places a formatted color legend list of departments in the drawing paper space.
- Generates solid color department hatches inside room boundaries using the hex colors defined in
Room Highlight / Outline Enhancement
EnhanceItems (EI): A list of room numbers (separated by semicolons;). Any room matching this list will have its boundary polyline highlighted in the drawing (color set to red/index 1 and border width line weight increased/doubled).EnhanceLineWeight (ELW): The value to use to increase the LineWeight of the Enhanced Items (defaults to 2).
Layer Configuration Parameters
- Room Layers (
RL): Specifies which layer names in the CAD file represent room boundaries (defaults to"RM$"under UIC drawing mode). - Text Layers (
TL): Specifies which layer names in the CAD file contain room number texts/labels (defaults to"RM$TXT"under UIC drawing mode). - Hatch Layers (
HL): Specifies the hatch boundary layers.
Typical Command Line
The typical command line is:
-i=”<InputPath>\S618-1.dwg” -svg -lpath=<licensepath> -rl=RM$ -tl=RM$TXT -ei=151 -elw=15
Note that the values shown for -rl and -tl are actually the defaults, so those could be omitted in this case.
Legend Sizing and Placement (Layout-dependent)
The legend’s location and orientation inside paper space adjust automatically depending on the presence of drawing layout pages:
8Playout page: Places vertical narrow columns on the left (x=.1, y=10).8Llayout page: Places vertical narrow columns on the left (x=.1, y=7).11Llayout page: Places horizontal columns at the bottom (x=3, y=3.5, width=3).11Playout page: Places columns at the bottom (x=5.5, y=5.5, height=3).