: Open Visual Studio and start a new C# Class Library project. Add References : Browse to your Revit installation folder. Add RevitAPI.dll (database functions). Add RevitAPIUI.dll (interface functions). Set Copy Local to False for both.

: Use uiApp.ActiveUIDocument.Selection to interact with what the user clicks.

[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] public class MyCommand : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { // 1. Get the Document UIApplication uiApp = commandData.Application; Document doc = uiApp.ActiveUIDocument.Document; // 2. Start a Transaction using (Transaction trans = new Transaction(doc, "My Customization")) { trans.Start(); // Your logic goes here (e.g., changing a parameter) trans.Commit(); } return Result.Succeeded; } } Use code with caution. Copied to clipboard 📝 Manifest Files (.addin)

: The primary way to "find" things in your model (like all Walls or Doors).

To help you move faster, would you like a code snippet for a (like auto-renaming levels) or a guide on debugging your code?

View All news

Back TO All

In Season

STAY CURRENT

Stay current with the latest news, policy activity and how to get involved.

Sign up for Newsletters
Instant Autodesk Revit 2013 Customization with ...

Tracking The Capitols

Receive latest legislation and regulation changes.

Sign Up For Legislative Alerts