Troubleshooting & Diagnostics
Learn how to debug compilation errors, script crashes, and connection issues in Revit AI Suite.
When building Dynamic UIs or C# scripting workflows, you may encounter compilation issues, script crashes, or visual panel errors. Use this page to troubleshoot and diagnose these issues.
1. Inspecting Live Interaction Logs
The backend stores detailed execution histories, parameters, and stack traces.
- Review Logs: Open the Developer Dashboard and navigate to the execution logs panel to view the history of commands.
- Script Failures: If the C# script failed, the log will output a detailed compiler or runtime stack trace from the Revit environment.
- Frontend Errors: If the Dynamic UI fails to compile or run, compilation and rendering errors are caught by React Error Boundary components and logged directly in the console or sent to the backend.
2. Dynamic UI Compilation Crashes
If the Dynamic UI canvas displays a blank screen or shows compilation errors:
- Check Imports: Verify that your imports are restricted to the supported libraries (
react,react-dom,lucide-react,recharts). Custom project directories or local components (e.g.@/components/ui) are not available inside the runtime environment. - Component Export: Ensure your JSX layout has a
default exportof a single React component function. - Change Handlers: Ensure standard
<select>and<input>elements use proper state update handlers (e.g.,onChange={(e) => setVal(e.target.value)}).
3. C# Script Execution Failures
If you get execution failures or JSON-RPC error codes:
- Method Name Mismatch: Check that the
methodNameparameter in ReactexecuteCsharp("MyMethod", ...)matches thescript_nameregistered in the server database exactly (case-sensitive). - Transaction Errors: If you modify the Revit model (creating walls, deleting views, modifying parameters) and get "Transaction not active", ensure your C# code wraps the changes inside a
using (Transaction tx = new Transaction(doc, "Name"))block. - Cache Misses (ScriptCache):
- If
ScriptCache.Get<T>(id)returnsnull, the cached ID could be stale or the cache was cleared. - Note:
ScriptCacheis cleared automatically whenever you switch layouts (set_active_ui_layout) to prevent memory leaks and stale references.
- If