PR: Parameter expression not evaluated when referenced parameter is empty (Walls and Doors)
- Dominant language
- C#
- Stars
- 637
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
### Problem Description
## Summary
When using the [parameter expression syntax](https://github.com/Autodesk/revit-ifc/wiki/Revit-IfcExporter-parameter-expression) (e.g. `{$this("ParameterName")}`) on a **Wall** or **Door**, the behavior is inconsistent. In some cases the expression is evaluated correctly and the resolved value is exported. In other cases, if the referenced parameter is **empty**, the literal expression text (e.g. `{$this("ParameterName")}`) is exported as-is into the IFC file instead of being evaluated or resolving to an empty/blank value.
This behavior appears irregular even within the same category: some Walls export correctly while others, with what appears to be the same setup, do not. The same inconsistency has been observed on Doors as well.
The parameter expression has been assigned via a **global parameter** (rather than typed individually into each element), so a typo in the expression itself can be ruled out as the cause.
## Steps to Reproduce
1. Create/select a Wall (or Door) instance in Revit.
2. Assign a text parameter with a parameter expression value, e.g. `{$this("Comments")}`, using a global parameter so the same expression is applied consistently across elements.
3. Leave the referenced parameter ("Comments" in this example) empty.
4. Export the model to IFC.
5. Inspect the resulting property value in the IFC file — on some Walls (and Doors), the literal string `{$this("Comments")}` appears instead of an evaluated/blank value, while on other elements of the same category the same setup exports correctly.
## Expected Behavior
When the referenced parameter is empty, the parameter expression should resolve to an empty/blank value, rather than exporting the raw, unevaluated expression string into the IFC model. Behavior should also be consistent across all instances of the same category.
## Actual Behavior
On both Walls and Doors, an empty referenced parameter sometimes causes the unevaluated expression text (e.g. `{$this("ParameterName")}`) to be written directly into the exported IFC property value. This does not happen consistently — some elements export correctly, others do not, despite seemingly identical setup and the expression being sourced from a single global parameter (ruling out a per-element typo).
## Environment
- Revit version: 2026.4.1 (build 20260406_1515(x64), version 26.4.10.51)
- IFC Exporter version: 26.4.1.0
- IFC schema used for export: IFC4x3 Reference View
## Additional Notes
The inconsistency (working on some elements, not others, across both Walls and Doors) is the main open question — not yet identified what differs between the elements that export correctly and those that don't. Since the expression is applied via a global parameter, a typo or inconsistent manual entry can be excluded as the cause. Happy to provide a sample model or additional test cases if useful.
### Revit Version
2026.4.x
### IFC for Revit Addon Version
26.4.1
### Windows Version
11 24H2
Contributor guide
Research direction
Start by reproducing the issue in Revit 2026.4.1 with the IFC Exporter 26.4.1 using Walls and Doors, a global parameter, and an empty referenced parameter. Trace the parameter-expression handling during IFC4x3 export and compare elements that succeed with those that emit the literal expression. Done means empty references produce a blank value consistently without exporting the raw expression text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100