Overview
Advanced prompting unlocks Maestro AI’s ability to produce higher‑complexity automations while still maintaining reliability and predictability.
This section teaches power‑user techniques for shaping AI‑generated scripts, including the use of Maestro Variables (MVARs), controlled logic, safe conditional branching, tighter code constraints, and multi-step workflows split into manageable pieces.
The goal is not to force the AI to produce massive, monolithic workflows — instead, it’s to use structured prompting to generate stable, modular automations that can be combined or improved inside the IDE.
5.5.1 Combining AI and MVARs
Overview
MVARs allow scripts to prompt users for inputs at run-time (e.g., levels, parameter names, text values, numbers).
Adding MVARs to your prompts ensures the generated script is reusable across multiple projects, eliminating hard-coded values.
How to Prompt for MVARs
Prompt Formula
“Add MVARs so the user can choose <VALUE> at run-time instead of hard-coding it.”
Example Prompt
Create a Python script for Revit that finds all walls on a user-selected level.
Use MVARs so the user can choose the target level and the text to write into the “Comments” parameter.
Apply the value to all walls on that level.
Expected AI Output (Conceptual)
- MVAR block added at the top of the script
- Variables injected where appropriate
- No hard-coded values
Common Use Cases
- Parameter names
- Naming prefixes/suffixes
- Levels/floors
- Boolean options (yes/no)
- Numeric thresholds
Best Practices
- Add MVARs only for values you expect to change often
- Avoid creating unnecessary prompts (keeps UX clean)
5.5.2 Prompting for Conditional Logic
Overview
Conditional logic is powerful but must be tightly defined for predictable AI behavior.
Ambiguous conditions produce unreliable code; explicit rules produce clean logic.
Design Principles for Conditional Prompts
When You Want IF/ELSE Logic
Be explicit:
- What is being checked
- What happens when the condition is true
- What happens when the condition is false
Template
If <CONDITION> is true, do <ACTION A>.
If it is false, do <ACTION B>.
If the parameter is missing, skip the element.
Good Example Prompt
Write a script that checks each selected door.
If the fire rating is “1 HR”, set Comments to “Check”.
If it is anything else, set Comments to “OK”.
If the fire rating parameter is missing, skip the element.
Bad Example Prompt
“Check fire ratings and fix doors.”
5.5.3 Prompting for Iteration
Overview
Loops are fundamental to Revit automations.
Maestro AI handles iteration reliably when the prompt defines:
- Collection source (selection/category/filter)
- Iteration order
- Element conditions
- Output/summary expectations
Template for Reliable Iteration
Collect all <CATEGORY> elements.
Loop through each element one at a time.
For each element, perform the following steps:
1. Read <PARAMETER>.
2. Check <CONDITION>.
3. Apply <ACTION>.
Keep a counter for how many elements were processed.
Print a final summary.
Use Cases
- Batch parameter updates
- Validation checks
- Applying view templates
- Collecting analytics for QA
Pitfalls to Avoid
- Nested loops without clear purpose
- Multi-category iteration
- Vague conditions
5.5.4 Prompting for Transactions & Error Handling
Overview
Good scripts treat Revit modifications with respect.
Prompts must explicitly tell Maestro AI to wrap changes safely.
Reliable Transaction Template
Wrap all model modifications in a transaction.
If an exception occurs, skip the element and continue.
Do not let one failure stop the entire script.
Example Prompt
Write a Python script that renames all selected sheets.
Wrap changes in a transaction.
If any sheet cannot be renamed due to conflicts, skip it and continue processing.
Expected Output Behaviors
- One main transaction
- Try/except blocks around sensitive operations
- Printed summary of skipped elements
5.5.5 Prompting for Multi-Step Scripts (Without Overloading AI)
Overview
Complex workflows should be broken into modular pieces.
AI breaks down when asked for 6+ unrelated steps in a single script.
Strategy for Reliable Multi-Step Automation
- Split the workflow into small components
- Generate each script with its own prompt
- Combine manually inside Maestro’s IDE
- Add MVARs for cross-step flexibility
- Deploy consolidated workflow as a package
Example: Poor Prompt
“Duplicate all views, rename them, apply view templates, place them on sheets, export PDFs, and clean unused views.”
This will fail or produce unstable logic.
Example: Properly Broken Down Prompts
Step 1 Prompt
Duplicate selected views and append “-CD” to the name.
Step 2 Prompt
Apply the “Coordination” view template to all duplicated views.
Step 3 Prompt
Place all duplicated views on new sheets using a selected title block.
Step 4 Prompt
Export all sheets created in this session as PDFs.
Step 5 Prompt
List unused views to clean later.
Result
A complete automation pipeline — stable, maintainable, and easier to refine.
Summary
Advanced prompting is about shaping Maestro AI to produce reliable, reusable scripts rather than forcing it into overly complex logic.
Key principles include:
- Use MVARs strategically
- Define conditional logic clearly
- Structure iteration with explicit rules
- Require transactions and safe error handling
- Break complex workflows into modular steps
This approach keeps automations robust, maintainable, and suitable for deployment across your team or entire firm.