excel-to-rvt
Import Excel data into RVT projects. Update element parameters, create schedules, and sync external data sources.
What this skill does
# Excel to RVT Import
> **Note:** RVT is the file format. Examples may reference Autodesk® Revit® APIs. Autodesk and Revit are registered trademarks of Autodesk, Inc.
## Business Case
### Problem Statement
External data (costs, specifications, classifications) lives in Excel but needs to update Revit:
- Cost estimates need to link to model elements
- Classification codes need assignment
- Custom parameters need population
- Manual entry is slow and error-prone
### Solution
Automated import of Excel data into Revit using the DDC ImportExcelToRevit tool and Dynamo workflows.
### Business Value
- **Automation** - Batch update thousands of parameters
- **Accuracy** - Eliminate manual data entry errors
- **Sync** - Keep external data in sync with model
- **Flexibility** - Update any writable parameter
## Technical Implementation
### Methods
1. **ImportExcelToRevit CLI** - Direct command-line update
2. **Dynamo Script** - Visual programming approach
3. **Revit API** - Full programmatic control
### ImportExcelToRevit CLI
```bash
ImportExcelToRevit.exe <model.rvt> <data.xlsx> [options]
```
| Option | Description |
|--------|-------------|
| `-sheet` | Excel sheet name |
| `-idcol` | Element ID column |
| `-mapping` | Parameter mapping file |
### Python Implementation
```python
import subprocess
import pandas as pd
from pathlib import Path
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass
import json
@dataclass
class ImportResult:
"""Result of Excel import to Revit."""
elements_processed: int
elements_updated: int
elements_failed: int
parameters_updated: int
errors: List[str]
class ExcelToRevitImporter:
"""Import Excel data into Revit models."""
def __init__(self, tool_path: str = "ImportExcelToRevit.exe"):
self.tool_path = Path(tool_path)
def import_data(self, revit_file: str,
excel_file: str,
sheet_name: str = "Elements",
id_column: str = "ElementId",
parameter_mapping: Dict[str, str] = None) -> ImportResult:
"""Import Excel data into Revit."""
# Build command
cmd = [
str(self.tool_path),
revit_file,
excel_file,
"-sheet", sheet_name,
"-idcol", id_column
]
# Add mapping file if provided
if parameter_mapping:
mapping_file = self._create_mapping_file(parameter_mapping)
cmd.extend(["-mapping", mapping_file])
# Execute
result = subprocess.run(cmd, capture_output=True, text=True)
# Parse result (format depends on tool)
return self._parse_result(result)
def _create_mapping_file(self, mapping: Dict[str, str]) -> str:
"""Create temporary mapping file."""
mapping_path = Path("temp_mapping.json")
with open(mapping_path, 'w') as f:
json.dump(mapping, f)
return str(mapping_path)
def _parse_result(self, result: subprocess.CompletedProcess) -> ImportResult:
"""Parse CLI result."""
# This is placeholder - actual parsing depends on tool output
if result.returncode == 0:
return ImportResult(
elements_processed=0,
elements_updated=0,
elements_failed=0,
parameters_updated=0,
errors=[]
)
else:
return ImportResult(
elements_processed=0,
elements_updated=0,
elements_failed=0,
parameters_updated=0,
errors=[result.stderr]
)
class DynamoScriptGenerator:
"""Generate Dynamo scripts for Revit data import."""
def generate_parameter_update_script(self,
mappings: Dict[str, str],
excel_path: str,
output_path: str) -> str:
"""Generate Dynamo Python script for parameter updates."""
mappings_json = json.dumps(mappings)
script = f'''
# Dynamo Python Script - Excel to Revit Parameter Update
# Generated by DDC
import clr
import sys
sys.path.append(r'C:\\Program Files (x86)\\IronPython 2.7\\Lib')
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
clr.AddReference('Microsoft.Office.Interop.Excel')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.DB import *
import Microsoft.Office.Interop.Excel as Excel
# Configuration
excel_path = r'{excel_path}'
mappings = {mappings_json}
# Open Excel
excel_app = Excel.ApplicationClass()
excel_app.Visible = False
workbook = excel_app.Workbooks.Open(excel_path)
worksheet = workbook.Worksheets[1]
# Get Revit document
doc = DocumentManager.Instance.CurrentDBDocument
# Read Excel data
used_range = worksheet.UsedRange
rows = used_range.Rows.Count
cols = used_range.Columns.Count
# Find column indices
headers = {{}}
for col in range(1, cols + 1):
header = str(worksheet.Cells[1, col].Value2 or '')
headers[header] = col
# Process rows
TransactionManager.Instance.EnsureInTransaction(doc)
updated_count = 0
error_count = 0
for row in range(2, rows + 1):
try:
# Get element ID
element_id_col = headers.get('ElementId', 1)
element_id = int(worksheet.Cells[row, element_id_col].Value2 or 0)
element = doc.GetElement(ElementId(element_id))
if not element:
continue
# Update mapped parameters
for excel_col, revit_param in mappings.items():
if excel_col in headers:
col_idx = headers[excel_col]
value = worksheet.Cells[row, col_idx].Value2
if value is not None:
param = element.LookupParameter(revit_param)
if param and not param.IsReadOnly:
if param.StorageType == StorageType.Double:
param.Set(float(value))
elif param.StorageType == StorageType.Integer:
param.Set(int(value))
elif param.StorageType == StorageType.String:
param.Set(str(value))
updated_count += 1
except Exception as e:
error_count += 1
TransactionManager.Instance.TransactionTaskDone()
# Cleanup
workbook.Close(False)
excel_app.Quit()
OUT = f"Updated: {{updated_count}}, Errors: {{error_count}}"
'''
with open(output_path, 'w') as f:
f.write(script)
return output_path
def generate_schedule_creator(self,
schedule_name: str,
category: str,
fields: List[str],
output_path: str) -> str:
"""Generate script to create Revit schedule from Excel structure."""
fields_json = json.dumps(fields)
script = f'''
# Dynamo Python Script - Create Schedule
# Generated by DDC
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
fields = {fields_json}
# Get category
category = Category.GetCategory(doc, BuiltInCategory.OST_{category})
TransactionManager.Instance.EnsureInTransaction(doc)
# Create schedule
schedule = ViewSchedule.CreateSchedule(doc, category.Id)
schedule.Name = "{schedule_name}"
# Add fields
definition = schedule.Definition
for field_name in fields:
# Find schedulable field
for sf in definition.GetSchedulableFields():
if sf.GetName(doc) == field_name:
definition.AddField(sf)
break
TransactionManager.Instance.TransactionTaskDone()
OUT = sRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.