Tutorial 1: Hello Revit
Your first Paracore script! Learn the basic structure, the Params class, and how to print output to the console.
Finished Script: 03_Tutorials/Paracore_Fundamentals/01_HelloRevit.cs
🎯 What You'll Learn
- The basic structure of a Paracore script
- How to create the
Paramsclass for user inputs - How to use
Println()to output text - Accessing Revit globals like
DocandUIApp
Step 1: Create a New Script
- In Paracore, click New Script in the toolbar
- Name it
HelloRevit - Click the ellipses (...) on the script card → Edit Script
- VS Code will open with your new script
Step 2: Write the Code
Replace the default content with:
// 1. Setup - instantiate params
var p = new Params();
var revitUserName = Doc.Application.Username;
// 2. Print a greeting to the console
Println($"{p.Message} {revitUserName}");
// 3. Parameters (MUST BE LAST)
public class Params {
#region Settings
/// <summary>
/// The greeting message to display.
/// </summary>
public string Message { get; set; } = "Welcome to Paracore";
#endregion
}
Step 3: Understand the Structure
The Params Class
Every Paracore script uses a Params class to define user inputs. The engine reads this class and generates a UI automatically.
public class Params {
public string Message { get; set; } = "Welcome to Paracore";
}
- Properties become UI controls (text boxes, dropdowns, etc.)
- Default values pre-fill the UI
- XML comments (
/// <summary>) become tooltips
Global Variables
Paracore provides several globals:
Doc- The current Revit DocumentUIApp- The Revit UI ApplicationUIDoc- The UI Document (for selections)
Println()
The Println() function outputs text to Paracore's console tab.
Step 4: Run and Verify
- Save in VS Code (
Ctrl+S) - Switch to Paracore
- Modify the "Message" parameter in the Parameters tab
- Click Run Script
- Check the Console tab for output
You should see something like:
Welcome to Paracore YourRevitUsername
💡 Try This
- Add another parameter for a number and print it
- Try accessing
Doc.Titleto print the document name - Add a second region group in the Params class
Next: Tutorial 2: Hello Wall →