This extension creates filled regions in the active Revit view based on rooms from linked Revit models, and then colors those regions according to an Excel mapping file. It is intended to support energy calculations and analysis by clearly visualizing different room types or categories in plan views.
The extension reads an Excel file where each row defines a room name and a color. It then:
- Creates a filled region over each matching room from linked models on the active level
- Tags each filled region with the room name in the
Comments parameter
- Creates and applies view filters in the active view so the filled regions are shown with the specified colors
The task has one configuration setting that appears as an input field in Assistant.
- Excel file path (
FilePath)
- What it is: Path to an Excel workbook (
.xlsx) that defines the colors for each room name.
- How to set it: Click the browse button in the task configuration and select your Excel file.
- Expected format: An
.xlsx file where:
- Column 1 (A): Room name (text). This will be matched against Revit room names.
- Column 2 (B): Color code (text), written as a standard HTML/HEX color (for example
#FF0000 for red, #00FF00 for green).
- Row 1 should contain headers; data starts from row 2.
- Effect on behavior:
- If this field is empty, the task will fail and no changes will be made.
- The color codes are used to style the filled regions created by the extension.
When you run this extension in an Assistant sequence, it performs the following steps:
- Checks that a Revit model is open and that there is an active view.
- Validates that the Excel file path is provided.
- Finds a filled region type in the current Revit model to use for new regions.
- In the active view, finds all Revit link instances.
- For each linked model:
- Collects all rooms.
- Filters rooms so that:
- The room has an area greater than zero.
- The room has a valid level.
- The room level name matches the level of the current active view.
- For each qualifying room:
- Extracts the room boundary from its bottom face.
- Transforms the boundary from the linked model’s coordinates into the host model’s coordinates.
- Creates a filled region in the active view that matches the room’s footprint.
- Writes a cleaned version of the room name into the filled region’s
Comments parameter.
- After creating at least one filled region, reads the Excel file row by row:
- For each row with a room name and color code:
- Cleans the room name to remove characters not allowed in Revit filter names.
- Ensures there is a parameter filter that checks the
Comments parameter for that cleaned room name.
- Adds the filter to the active view, targeting detail components (the category used by the filled regions).
- Applies graphic overrides so filled regions with that comment are shown with a solid fill and the specified color.
- Commits all changes in a single Revit transaction.
- Returns a summary message with the number of filled regions created and the number of rooms that could not be processed.
-
Prepare the Excel file
- Create an
.xlsx file (for example in Excel).
- In row 1, add headers, for example
RoomName in column A and Color in column B.
- Starting from row 2, list the rooms:
- Column A: Room name exactly as it appears in Revit (for example
OFFICE 01).
- Column B: Color code in HEX format (for example
#FFD700 for yellow, #1E90FF for blue).
- Save the file in a location accessible to all users who will run the extension.
-
Check the Revit model and view
- Open the host Revit model.
- Ensure the linked Revit models containing the rooms are loaded and visible in the active view.
- Activate a plan view where you want the filled regions to be created.
- Confirm that the active view’s level matches the levels of the rooms you want to process.
-
Configure the Assistant task
- Add the
Create Filled Region For Energy Calculation task to your Assistant sequence.
- In the configuration, use the browse button to select your prepared Excel file.
- Save the task configuration.
-
Run and review
- Run the Assistant sequence.
- After completion, read the task output message to see how many filled regions were created and how many rooms failed.
- In Revit, check the active view:
- Filled regions should cover rooms from the linked models on the active level.
- Colors should match the definitions in your Excel file.
- Optionally adjust the Excel file and rerun the task if colors or names need tweaking.
- Causes: The extension is run when no Revit model is open, or Revit is not in a state where an active document is available.
- Solution: Open the required Revit model and ensure a view is active, then run the Assistant sequence again.
- Resources: Revit help on managing documents and views.
- Causes: The
Excel file path field in the task configuration is not filled in, or the configuration was not saved.
- Solution: Edit the task configuration, browse to the correct
.xlsx file, save, and rerun.
- Resources: Assistant documentation on configuring extension tasks.
- Causes: The current Revit project does not contain any
Filled Region Type elements.
- Solution: In Revit, create at least one filled region type (for example by drawing a filled region manually and saving the type), then rerun the task.
- Resources: Revit documentation on filled regions and filled region types.
- Causes:
- Room has zero area or is not properly bounded.
- Room has no level assigned or the level name does not match the active view’s level.
- Room geometry is too complex or invalid.
- Solution:
- Check the room’s boundaries and level in the linked model.
- Ensure the active view level matches the target rooms’ level.
- Review room boundaries and fix gaps or overlaps.
- Resources: Revit documentation on rooms, room boundaries, and linked models.
- Causes:
- Room names in the Excel file do not match the values stored in the filled regions’
Comments parameter after cleaning.
- Color codes are not valid HEX/HTML color strings.
- Solution:
- Ensure room names in Excel match the room names in Revit after removing special characters (such as
:, /, \, @, %, etc.).
- Use standard HEX color codes (for example
#RRGGBB).
- Re-run the task after correcting the Excel file.
- Resources: General documentation on HTML color codes, Revit parameter filters.
-
Q: When should I use this extension?
- A: Use this extension when you need a clear, color-coded plan representation of rooms from linked Revit models for energy calculations, area analysis, or design coordination. It is particularly helpful when working with external architectural models.
-
Q: Does this extension modify the linked models?
- A: No. All filled regions and filters are created in the host model’s active view. The linked models remain unchanged.
-
Q: Which views does the extension affect?
- A: Only the currently active view when the task runs. If you want the same visualization in multiple views, run the extension in each relevant view or duplicate the view after running.
-
Q: What categories are affected by the view filters?
- A: The extension targets the
Detail Items category (detail components), which is where the filled regions belong.
-
Q: What happens if I run the extension multiple times?
- A: Existing view filters with the same names are removed from the active view and recreated, so colors are updated. Existing filled regions are not automatically deleted; you may want to clean up old regions manually before rerunning.